Copy link to clipboard
Copied
The button nested in a movieclip has been set to false like this, and code is placed inside the movieclip.
The code on the main timeline:
stage.addEventListener(Event.ENTER_FRAME, enableBtn);
function enableBtn(event:Event):void{
if(currentFrame==21){
nav_mov.theBtn.mouseEnabled = true;
}
}
The code to set the button to false which is placed in the movieClip
theBtn.mouseEnabled = false;
The movieClip is placed on the main time line.
Thank you very much for your help.
that doesn't make sense.
create a new fla. copy and paste your code to frame 1. add a keyframe at frame 21. add a movieclip (nav_mov) on frame 21. in frame 1 of nav_mov at a simple button (theBtn).
test. any problems?
if not, in what relevant way is your original fla different from the one i suggested you create for testing purposes?
Copy link to clipboard
Copied
if the button exists when your code executes, what's the problem?
Copy link to clipboard
Copied
Thank you for the reply! When the swf is running, got the error message 1119: Access of possibly undefined property label through a reference with static type flash.display:SimpleButton.
Copy link to clipboard
Copied
click file>publish settings>swf and tick 'permit debugging'. retest.
the line number/timeline/layer of the problematic code will be in the error message. which line of code is triggering that error?
Copy link to clipboard
Copied
the line of the error: nav_mov.theBtn.mouseEnabled = true;
Thank you!
Copy link to clipboard
Copied
that doesn't make sense.
create a new fla. copy and paste your code to frame 1. add a keyframe at frame 21. add a movieclip (nav_mov) on frame 21. in frame 1 of nav_mov at a simple button (theBtn).
test. any problems?
if not, in what relevant way is your original fla different from the one i suggested you create for testing purposes?
Copy link to clipboard
Copied
Thank you so much for the help!!! I finally found the problem. That's my mistake. I didn't give the instance name for the movie clip: nav_mov. Now the code works fine. Thank you! Have a wonderful weekend!
Copy link to clipboard
Copied
Thank you so much for the help!!! I finally found the problem. That's my mistake. I didn't give the instance name for the movie clip: nav_mov. Now the code works fine. Thank you! Have a wonderful weekend!
Copy link to clipboard
Copied
you're welcome.
p.s. please mark helpful/correct responses.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now