A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: how do you do this? please help

  1. #1
    Senior Member Celtic_K's Avatar
    Join Date
    Dec 2004
    Posts
    238

    how do you do this? please help

    ok this is what i want to do.



    i have to flags on my timeline "flag_a" and "flag_b"

    I also have a button.

    I want it so when i click the button it gotoandplays flag_a and when its done flag_a it automatically gotoandplays flag_b


    any way i can do this?


    Thanks.

  2. #2
    Member Pepember
    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    886
    by flags you mean frame labels?
    on the button:
    on (release){
    _root.gotoAndPlay("flag_a");
    }
    and on the main timeline keyframe that's supposed to take you to the next label:
    gotoAndPlay("flag_b");
    Please sign here

  3. #3
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    I guess flag_a and flag_b are movie clips, right?

    One solution is:
    playing flag_a with a simple:
    code:

    my_btn.onRelease = function()
    {
    flag_a.play();
    }


    and in the last frame of flag_a have:
    code:

    _parent.flag_b.play();



    Another solution, if you don't want to attach code to flag_b:
    code:

    my_btn.onRelease = function()
    {
    // play the movie clip
    flag_a.play();
    // while the movie clip is playing
    flag_a.onEnterFrame = function()
    {
    // see if it has already reached the last frame
    // if it has...
    if (this._currentframe == this._totalframes)
    {
    // stop it, delete the method
    this.stop();
    delete this.onEnterFrame;
    // and play the other movie clip
    flag_b.play();
    }
    };
    };


    All the code has to be attached to the timeline.

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