PDA

View Full Version : _visibility and gotoAndPlay



mtran
09-28-2006, 04:57 PM
I have:
frame1[key frame]--->frame4 : intro_btn._visible = true;
frame5[key frame]---> fram30: intro_btn._visible = false;

My simple question is: why when the timeline runs by itself, my button visibility changes ok, but if I use gotoAndPlay(6), my button visibility is still "true," instead of "false."

I know f6 is not a key frame, but on the timeline, the actionscript goes from 1-4, and 5-30, so the actions should be effective for all those frames? Am I right?

What else should I do in order to use gotoAndPlay(6) as above besides turning 6 into a keyframe?

BLiZZaRD
09-29-2006, 08:26 AM
The simple answer is because of the way Flash reads the timeline.

Think of it as hop-scotch. You start on 1, and jump to 3, completley by-passing 2.

Same thing, any rules you make on frame 5 will only be in effect if the time line lands on 5, if you by-pass it Flash will remember only the last rules it landed on.

The best way to do something like that is to add:



on(release){
intro_btn._visible = false;
}


To the button you have the gotoAndPlay96); on.