Hi, I’ve been trying to adapt to AS3 for a few days and am learning the new methods… I have a movieclip that i am loading in from the library using the addChild() code. When the movieclip has played through the timeline I wanted to put a removeMovieClip() command in the end so it self-removes once its completed.
I’ve had some success using the following code:
var par:MovieClip=MovieClip(parent);
var par1:MovieClip=MovieClip(par.parent);
par1.removeChild(par)
(the timeline is within a clip within the loaded movie)
and it seems to work, for a while and then after maybe the fourth time it will give me this error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at tunnel_trial4_fla::MC_WallCrawler_Grow_15/frame140()
and then will work every other time.
The reason for the failure is that par1 is returning null.
Can anyone suggest why or at least where to look? I know some people have suggested this isn’t the way to handle parent/child things. But Im still learning and I can’t see why this wouldn’t work.
Ta
Matt.