I've just started learning about classes and Flash in general.
I created a little Flash file that used classes and all was working well.
But then I decided I wanted to move all of what I'd done on the main timeline into a Movie Clip. Now most things don't work.
I'm guessing that the things in the class were 'linking' or 'referring' to things on the main scene 1 stage which are now in a movie clip.
I've tried to fix it but haven't had any luck. I'm getting errors like:
TypeError: Error #2007: Parameter hitTestObject must be non-null.
at flash.display:isplayObject/_hitTest()
at flash.display:isplayObject/hitTestObject()
at DragDrop/drop()
I'm uploading the two class files and the fla file for a clearer picture of what is happening. I'll also upload the working versions before I moved it into a movie clip.
I've moved it into a movie clip as I want to have the same pieces of action happening multiple times and guessed this was the best way... Is it?
Thanks but I'm now getting this error:
Map.as, Line 22 1084: Syntax error: expecting identifier before this.
For this line: currentObject.this = getChildByName(currentObject.name + "_target");
Ok, have done that. Now getting this error:
DragDrop.as, Line 10 1084: Syntax error: expecting identifier before this.
Line 10: var thisisplayObject;
And also these errors:
Map.as, Line 1 5000: The class 'Map' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
DragDrop.as, Line 1 5000: The class 'DragDrop' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
DragDrop.as, Line 1 5000: The class 'DragDrop' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
DragDrop.as, Line 1 5000: The class 'DragDrop' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
DragDrop.as, Line 1 5000: The class 'DragDrop' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
Just get back to the original class and then change
if(hitTestObject(target))
to
if(hitTestObject(this))
You can delete the line var targetisplayObject;
That line was nonsense from the beginning, because target was not defined in that class. That is why it gave null.
C:\Users\Joe\Documents\Flash\Map.as, Line 17 1120: Access of undefined property red1.
C:\Users\Joe\Documents\Flash\Map.as, Line 17 1120: Access of undefined property blue1.
C:\Users\Joe\Documents\Flash\Map.as, Line 17 1120: Access of undefined property blue2.
C:\Users\Joe\Documents\Flash\Map.as, Line 17 1120: Access of undefined property yellow1.
C:\Users\Joe\Documents\Flash\Map.as, Line 17 1120: Access of undefined property green1.
C:\Users\Joe\Documents\Flash\Map.as, Line 22 1119: Access of possibly undefined property target through a reference with static type DragDrop.
Line 17: buttonMode = true;
Line 22: stage.addEventListener(MouseEvent.MOUSE_UP, drop);