TypeError : Erreur 1009
- enteka
- Born


- Inscription: Aoû 24, 2011
- Messages: 1
- Status: Offline
Pourquoi j'obtiens le message en anglais ?J'ai écrit en espagnol...
Bonjour à tous. Je suis novice dans le Forum et actionscript aussi et j'ai besoin de votre aide. Je suis la conception de jeu didactique en As3 avec Adobe Flash. Le jeu aura plusieurs scènes, mais je suis encore dans le premier. La scène a plusieurs boutons qui mène à un autre article avec vos pages (ou écrans) pertinentes. Le code actionscript utiliser pour toutes les images clés dans la principale chronologie (scénario principal). Maintenant je veux mettre une série d'écrans où l'étudiant peut agarrrar et faites glisser (drag and drop) les caractères à leurs sites Web correspondants.
J'ai d'abord essayé de déposer un cadre unique et le code actionscript pour voir si travaille pour le jeu et tout. Ensuite, j'ai essayé d'élargir le jeu en ajoutant un autre cadre pour passer à un autre écran de glisser déplacer. J'inserté le code dans la nouvelle image-clé dans la ligne d'actionscript et j'ai modifié le code, lorsque cela est nécessaire.
Mais maintenant je me sens quelque chose de très bizarre : quand je teste le film en flash, je peux jouer le jeu de la première image clé sans problème, mais quand je saute à la deuxième période (pour le deuxième écran), apparaissent les symboles tracées sur la 1ère image également dans le 2ème et de plus vous pouvez faire glisser. Et le même vice versa, c'est-à-dire lorsque je viens arrière à l'aide d'un bouton au cadre de la 1ère, get me glisser des symboles de la deuxième période.
L'erreur que j'obtiens est :
TypeError : Erreur #1009 : il ne peut accéder à une propriété ou une méthode d'une référence à un objet null.
(à draganddroparabe_fla : MainTimeline/mdown)
TypeError : Erreur #1009 : il ne peut accéder à une propriété ou une méthode d'une référence à un objet null.
(à draganddroparabe_fla : MainTimeline/mUp)
Je suis allé presque folle, que j'ai modifié beaucoup de choses à voir si je pouvais fix it moi-même, mais je suis arrivé à un point que je ne sais pas ce qui reste à faire. Et je ne comprends pas comment les symboles peuvent être visibles.
Je soupçonne que le problème réside dans le code suivant (capable de vous devez insérer quelque chose) :
Image 1
Code :
Cadre 2
Code :
Eh bien, je ne pas savoir si je l'ai expliqué bien (sinon, me dire). C'est que tout est très nouveau pour moi et Im d'apprentissage à la volée avec problèmes ainsi. J'espère que quelqu'un peut me prêter un coup de main. Ils pourraient préférer voir tout le code, elle-même peut-être (j'espère qu'il n'importe pas) :
IMAGE 1
Code :
Que puis-je faire ?
Salutations,
Enteka
Bonjour à tous. Je suis novice dans le Forum et actionscript aussi et j'ai besoin de votre aide. Je suis la conception de jeu didactique en As3 avec Adobe Flash. Le jeu aura plusieurs scènes, mais je suis encore dans le premier. La scène a plusieurs boutons qui mène à un autre article avec vos pages (ou écrans) pertinentes. Le code actionscript utiliser pour toutes les images clés dans la principale chronologie (scénario principal). Maintenant je veux mettre une série d'écrans où l'étudiant peut agarrrar et faites glisser (drag and drop) les caractères à leurs sites Web correspondants.
J'ai d'abord essayé de déposer un cadre unique et le code actionscript pour voir si travaille pour le jeu et tout. Ensuite, j'ai essayé d'élargir le jeu en ajoutant un autre cadre pour passer à un autre écran de glisser déplacer. J'inserté le code dans la nouvelle image-clé dans la ligne d'actionscript et j'ai modifié le code, lorsque cela est nécessaire.
Mais maintenant je me sens quelque chose de très bizarre : quand je teste le film en flash, je peux jouer le jeu de la première image clé sans problème, mais quand je saute à la deuxième période (pour le deuxième écran), apparaissent les symboles tracées sur la 1ère image également dans le 2ème et de plus vous pouvez faire glisser. Et le même vice versa, c'est-à-dire lorsque je viens arrière à l'aide d'un bouton au cadre de la 1ère, get me glisser des symboles de la deuxième période.
L'erreur que j'obtiens est :
TypeError : Erreur #1009 : il ne peut accéder à une propriété ou une méthode d'une référence à un objet null.
(à draganddroparabe_fla : MainTimeline/mdown)
TypeError : Erreur #1009 : il ne peut accéder à une propriété ou une méthode d'une référence à un objet null.
(à draganddroparabe_fla : MainTimeline/mUp)
Je suis allé presque folle, que j'ai modifié beaucoup de choses à voir si je pouvais fix it moi-même, mais je suis arrivé à un point que je ne sais pas ce qui reste à faire. Et je ne comprends pas comment les symboles peuvent être visibles.
Je soupçonne que le problème réside dans le code suivant (capable de vous devez insérer quelque chose) :
Image 1
Code :
Code: [ Select ]
//---función del fotograma 1---\
function mdown(e:MouseEvent):void {
e.currentTarget.startDrag();
setChildIndex(MovieClip(e.currentTarget), numChildren - 1);
response_mc.gotoAndStop(1);
}
function mUp(e:MouseEvent):void {
var dropIndex:int = dropArray.indexOf(e.currentTarget);
var target:MovieClip = e.currentTarget as MovieClip;
target.stopDrag();
if (target.hitTestObject(hitArray[dropIndex])) {
target.x = hitArray[dropIndex].x;
target.y = hitArray[dropIndex].y;
playSound(SoundId);
response_mc.gotoAndStop(2);
}else{
target.x = positionsArray[dropIndex].xPos;
target.y = positionsArray[dropIndex].yPos;
playSound(SoundId2);
response_mc.gotoAndStop(3);
}
}
function mdown(e:MouseEvent):void {
e.currentTarget.startDrag();
setChildIndex(MovieClip(e.currentTarget), numChildren - 1);
response_mc.gotoAndStop(1);
}
function mUp(e:MouseEvent):void {
var dropIndex:int = dropArray.indexOf(e.currentTarget);
var target:MovieClip = e.currentTarget as MovieClip;
target.stopDrag();
if (target.hitTestObject(hitArray[dropIndex])) {
target.x = hitArray[dropIndex].x;
target.y = hitArray[dropIndex].y;
playSound(SoundId);
response_mc.gotoAndStop(2);
}else{
target.x = positionsArray[dropIndex].xPos;
target.y = positionsArray[dropIndex].yPos;
playSound(SoundId2);
response_mc.gotoAndStop(3);
}
}
- //---función del fotograma 1---\
- function mdown(e:MouseEvent):void {
- e.currentTarget.startDrag();
- setChildIndex(MovieClip(e.currentTarget), numChildren - 1);
- response_mc.gotoAndStop(1);
- }
- function mUp(e:MouseEvent):void {
- var dropIndex:int = dropArray.indexOf(e.currentTarget);
- var target:MovieClip = e.currentTarget as MovieClip;
- target.stopDrag();
- if (target.hitTestObject(hitArray[dropIndex])) {
- target.x = hitArray[dropIndex].x;
- target.y = hitArray[dropIndex].y;
- playSound(SoundId);
- response_mc.gotoAndStop(2);
- }else{
- target.x = positionsArray[dropIndex].xPos;
- target.y = positionsArray[dropIndex].yPos;
- playSound(SoundId2);
- response_mc.gotoAndStop(3);
- }
- }
Cadre 2
Code :
Code: [ Select ]
//---parte del fotograma 2---\
function mdown1(a:MouseEvent):void {
a.currentTarget.startDrag();
setChildIndex(MovieClip(a.currentTarget), numChildren - 1);
response2_mc.gotoAndStop(1);
}
function mUp1(a:MouseEvent):void {
var dropIndex2:int = dropArray2.indexOf(a.currentTarget);
var target2:MovieClip = a.currentTarget as MovieClip;
target2.stopDrag();
if (target2.hitTestObject(hitArray2[dropIndex2])) {
target2.x = hitArray2[dropIndex2].x;
target2.y = hitArray2[dropIndex2].y;
playSound3(SoundId3);
response2_mc.gotoAndStop(2);
}else{
target2.x = positionsArray2[dropIndex2].xPos;
target2.y = positionsArray2[dropIndex2].yPos;
playSound4(SoundId4);
response2_mc.gotoAndStop(3);
}
}
function mdown1(a:MouseEvent):void {
a.currentTarget.startDrag();
setChildIndex(MovieClip(a.currentTarget), numChildren - 1);
response2_mc.gotoAndStop(1);
}
function mUp1(a:MouseEvent):void {
var dropIndex2:int = dropArray2.indexOf(a.currentTarget);
var target2:MovieClip = a.currentTarget as MovieClip;
target2.stopDrag();
if (target2.hitTestObject(hitArray2[dropIndex2])) {
target2.x = hitArray2[dropIndex2].x;
target2.y = hitArray2[dropIndex2].y;
playSound3(SoundId3);
response2_mc.gotoAndStop(2);
}else{
target2.x = positionsArray2[dropIndex2].xPos;
target2.y = positionsArray2[dropIndex2].yPos;
playSound4(SoundId4);
response2_mc.gotoAndStop(3);
}
}
- //---parte del fotograma 2---\
- function mdown1(a:MouseEvent):void {
- a.currentTarget.startDrag();
- setChildIndex(MovieClip(a.currentTarget), numChildren - 1);
- response2_mc.gotoAndStop(1);
- }
- function mUp1(a:MouseEvent):void {
- var dropIndex2:int = dropArray2.indexOf(a.currentTarget);
- var target2:MovieClip = a.currentTarget as MovieClip;
- target2.stopDrag();
- if (target2.hitTestObject(hitArray2[dropIndex2])) {
- target2.x = hitArray2[dropIndex2].x;
- target2.y = hitArray2[dropIndex2].y;
- playSound3(SoundId3);
- response2_mc.gotoAndStop(2);
- }else{
- target2.x = positionsArray2[dropIndex2].xPos;
- target2.y = positionsArray2[dropIndex2].yPos;
- playSound4(SoundId4);
- response2_mc.gotoAndStop(3);
- }
- }
Eh bien, je ne pas savoir si je l'ai expliqué bien (sinon, me dire). C'est que tout est très nouveau pour moi et Im d'apprentissage à la volée avec problèmes ainsi. J'espère que quelqu'un peut me prêter un coup de main. Ils pourraient préférer voir tout le code, elle-même peut-être (j'espère qu'il n'importe pas) :
IMAGE 1
Code :
Code: [ Select ]
stop();
next1.addEventListener(MouseEvent.CLICK,clickNext1);
function clickNext1(event:MouseEvent):void
{
gotoAndStop("getPagina2");
}
//Array to hold the target instances, the drop instances,
//and the start positions of the drop instances.
var score:Number = 0;
var hitArray:Array = new Array(hitTarget1,hitTarget2,hitTarget3,hitTarget4);
var dropArray:Array = new Array(drop1,drop2,drop3,drop4);
var positionsArray:Array = new Array();
//This adds the mouse down and up listener to the drop instances
//and add the starting x and y positions of the drop instances
//into the array.
for (var i:int = 0; i < dropArray.length; i++) {
dropArray[i].buttonMode = true;
dropArray[i].addEventListener(MouseEvent.MOUSE_DOWN, mdown);
dropArray[i].addEventListener(MouseEvent.MOUSE_UP, mUp);
positionsArray.push({xPos:dropArray[i].x, yPos:dropArray[i].y});
}
//This drags the object that has been selected and moves it
//to the top of the display list. This means you can't drag
//this object underneath anything.
function mdown(e:MouseEvent):void {
e.currentTarget.startDrag();
setChildIndex(MovieClip(e.currentTarget), numChildren - 1);
response_mc.gotoAndStop(1);
}
//This stops the dragging of the selected object when the mouse is
//released. If the object is dropped on the corresponding target
//then it get set to the x and y position of the target. Otherwise
//it returns to the original position.
function mUp(e:MouseEvent):void {
var dropIndex:int = dropArray.indexOf(e.currentTarget);
var target:MovieClip = e.currentTarget as MovieClip;
target.stopDrag();
if (target.hitTestObject(hitArray[dropIndex])) {
target.x = hitArray[dropIndex].x;
target.y = hitArray[dropIndex].y;
playSound(SoundId);
response_mc.gotoAndStop(2);
}else{
target.x = positionsArray[dropIndex].xPos;
target.y = positionsArray[dropIndex].yPos;
playSound(SoundId2);
response_mc.gotoAndStop(3);
}
}
function playSound(SoundId:Class):void{
var sound = new SoundId();
var channel:SoundChannel = sound.play();
}
function playSound2(SoundId2:Class):void{
var sound = new SoundId2();
var channel:SoundChannel = sound.play();
}
reset.addEventListener(MouseEvent.CLICK, backObjects);
function backObjects(e:MouseEvent):void{
for(var i:int = 0; i < dropArray.length; i++){
if(dropArray[i].x == hitArray[i].x && dropArray[i].y == hitArray[i].y){
dropArray[i].x = positionsArray[i].xPos;
dropArray[i].y = positionsArray[i].yPos;
response_mc.gotoAndStop(1);
}
}
}
next1.addEventListener(MouseEvent.CLICK,clickNext1);
function clickNext1(event:MouseEvent):void
{
gotoAndStop("getPagina2");
}
//Array to hold the target instances, the drop instances,
//and the start positions of the drop instances.
var score:Number = 0;
var hitArray:Array = new Array(hitTarget1,hitTarget2,hitTarget3,hitTarget4);
var dropArray:Array = new Array(drop1,drop2,drop3,drop4);
var positionsArray:Array = new Array();
//This adds the mouse down and up listener to the drop instances
//and add the starting x and y positions of the drop instances
//into the array.
for (var i:int = 0; i < dropArray.length; i++) {
dropArray[i].buttonMode = true;
dropArray[i].addEventListener(MouseEvent.MOUSE_DOWN, mdown);
dropArray[i].addEventListener(MouseEvent.MOUSE_UP, mUp);
positionsArray.push({xPos:dropArray[i].x, yPos:dropArray[i].y});
}
//This drags the object that has been selected and moves it
//to the top of the display list. This means you can't drag
//this object underneath anything.
function mdown(e:MouseEvent):void {
e.currentTarget.startDrag();
setChildIndex(MovieClip(e.currentTarget), numChildren - 1);
response_mc.gotoAndStop(1);
}
//This stops the dragging of the selected object when the mouse is
//released. If the object is dropped on the corresponding target
//then it get set to the x and y position of the target. Otherwise
//it returns to the original position.
function mUp(e:MouseEvent):void {
var dropIndex:int = dropArray.indexOf(e.currentTarget);
var target:MovieClip = e.currentTarget as MovieClip;
target.stopDrag();
if (target.hitTestObject(hitArray[dropIndex])) {
target.x = hitArray[dropIndex].x;
target.y = hitArray[dropIndex].y;
playSound(SoundId);
response_mc.gotoAndStop(2);
}else{
target.x = positionsArray[dropIndex].xPos;
target.y = positionsArray[dropIndex].yPos;
playSound(SoundId2);
response_mc.gotoAndStop(3);
}
}
function playSound(SoundId:Class):void{
var sound = new SoundId();
var channel:SoundChannel = sound.play();
}
function playSound2(SoundId2:Class):void{
var sound = new SoundId2();
var channel:SoundChannel = sound.play();
}
reset.addEventListener(MouseEvent.CLICK, backObjects);
function backObjects(e:MouseEvent):void{
for(var i:int = 0; i < dropArray.length; i++){
if(dropArray[i].x == hitArray[i].x && dropArray[i].y == hitArray[i].y){
dropArray[i].x = positionsArray[i].xPos;
dropArray[i].y = positionsArray[i].yPos;
response_mc.gotoAndStop(1);
}
}
}
- stop();
- next1.addEventListener(MouseEvent.CLICK,clickNext1);
- function clickNext1(event:MouseEvent):void
- {
- gotoAndStop("getPagina2");
- }
- //Array to hold the target instances, the drop instances,
- //and the start positions of the drop instances.
- var score:Number = 0;
- var hitArray:Array = new Array(hitTarget1,hitTarget2,hitTarget3,hitTarget4);
- var dropArray:Array = new Array(drop1,drop2,drop3,drop4);
- var positionsArray:Array = new Array();
- //This adds the mouse down and up listener to the drop instances
- //and add the starting x and y positions of the drop instances
- //into the array.
- for (var i:int = 0; i < dropArray.length; i++) {
- dropArray[i].buttonMode = true;
- dropArray[i].addEventListener(MouseEvent.MOUSE_DOWN, mdown);
- dropArray[i].addEventListener(MouseEvent.MOUSE_UP, mUp);
- positionsArray.push({xPos:dropArray[i].x, yPos:dropArray[i].y});
- }
- //This drags the object that has been selected and moves it
- //to the top of the display list. This means you can't drag
- //this object underneath anything.
- function mdown(e:MouseEvent):void {
- e.currentTarget.startDrag();
- setChildIndex(MovieClip(e.currentTarget), numChildren - 1);
- response_mc.gotoAndStop(1);
- }
- //This stops the dragging of the selected object when the mouse is
- //released. If the object is dropped on the corresponding target
- //then it get set to the x and y position of the target. Otherwise
- //it returns to the original position.
- function mUp(e:MouseEvent):void {
- var dropIndex:int = dropArray.indexOf(e.currentTarget);
- var target:MovieClip = e.currentTarget as MovieClip;
- target.stopDrag();
- if (target.hitTestObject(hitArray[dropIndex])) {
- target.x = hitArray[dropIndex].x;
- target.y = hitArray[dropIndex].y;
- playSound(SoundId);
- response_mc.gotoAndStop(2);
- }else{
- target.x = positionsArray[dropIndex].xPos;
- target.y = positionsArray[dropIndex].yPos;
- playSound(SoundId2);
- response_mc.gotoAndStop(3);
- }
- }
- function playSound(SoundId:Class):void{
- var sound = new SoundId();
- var channel:SoundChannel = sound.play();
- }
- function playSound2(SoundId2:Class):void{
- var sound = new SoundId2();
- var channel:SoundChannel = sound.play();
- }
- reset.addEventListener(MouseEvent.CLICK, backObjects);
- function backObjects(e:MouseEvent):void{
- for(var i:int = 0; i < dropArray.length; i++){
- if(dropArray[i].x == hitArray[i].x && dropArray[i].y == hitArray[i].y){
- dropArray[i].x = positionsArray[i].xPos;
- dropArray[i].y = positionsArray[i].yPos;
- response_mc.gotoAndStop(1);
- }
- }
- }
Que puis-je faire ?
Salutations,
Enteka
- Anonymous
- Bot


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Août 24th, 2011, 3:21 pm
Page 1 sur 1
Pour répondre à ce sujet, vous devez vous connecter ou vous enregistrer. Il est gratuit.
Afficher de l'information
- Total des messages de ce sujet: 1 message
- Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 49 invités
- Vous ne pouvez pas poster de nouveaux sujets
- Vous ne pouvez pas répondre aux sujets
- Vous ne pouvez pas éditer vos messages
- Vous ne pouvez pas supprimer vos messages
- Vous ne pouvez pas joindre des fichiers
