A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: _visibility and gotoAndPlay

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    7

    _visibility and gotoAndPlay

    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?

  2. #2
    Senior Member
    Join Date
    Oct 2003
    Posts
    1,354
    You are skipping frame 5, so no actions on frame 5 are played.

    You could use an onEnterFrame function to constantly check the location of the playhead and set the visibility accordingly..

    on the time line where the intro_btn is placed:
    Code:
    onEnterFrame = function(){
    	if (this._currentframe <5){
    		intro_btn._visible = true;
    	} else {
    		intro_btn._visible = false;
    	}
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center