pangemedia
05-06-2010, 12:17 PM
hi,
I'm noob to AS3 and I'm having trouble with linking a button from one movieclip to another.
The code I'm using is:
back_btn.addEventListener(MouseEvent.CLICK, onPlayClick);
function onPlayClick(event:MouseEvent):void
{
MovieClip(this.parent).teste.gotoAndPlay();
}
back_btn - instance name of my button
teste - instance name of the movie I want to be linking to...
I've already tried adding other ".parent", related to the position of my movieclip in the scene. I also tried ".root" instead of parent and it still doesn't work.
I get errors like:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flash_site2_fla::activator_2/frame1()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flash_site2_fla::activator_2/frame1()
Can someone, anyone, help?
Thanks in advance...
I'm noob to AS3 and I'm having trouble with linking a button from one movieclip to another.
The code I'm using is:
back_btn.addEventListener(MouseEvent.CLICK, onPlayClick);
function onPlayClick(event:MouseEvent):void
{
MovieClip(this.parent).teste.gotoAndPlay();
}
back_btn - instance name of my button
teste - instance name of the movie I want to be linking to...
I've already tried adding other ".parent", related to the position of my movieclip in the scene. I also tried ".root" instead of parent and it still doesn't work.
I get errors like:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flash_site2_fla::activator_2/frame1()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flash_site2_fla::activator_2/frame1()
Can someone, anyone, help?
Thanks in advance...