A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Simple Button Issue

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    4

    Simple Button Issue

    Hi there,
    I'm sure there has to be a solution to my issue, I have been using Flash for years, but I haven't been asked to design a site in flash for some time so I'm a bit rusty.

    Anyway what I need to do is have a movie clip finish playing when a button is clicked and then go to the frame label associated with the button. I hope I'm explaining myself ok.

    So if I had say 4 buttons
    Home Gallery About Contact

    If Contact is clicked then I want the Home page to play (Which is a fade out) and then go to Contact Page (which will fade in). Then If Gallery is clicked then I want Contact to fade out and then go to Gallery page and fade in.

    If I can clarify better please let me know.
    Any help is appreciated.
    Thanks

  2. #2
    Moderator enpstudios's Avatar
    Join Date
    Jun 2001
    Location
    Tampa, Fl.
    Posts
    11,282
    What I used to do was to create a global variable named "frame"
    I would then have the movieclip play the fade out sequence and when it hits the last frame it would look at the global variable "frame: and see what the value is to determine what to play next:



    Actionscript Code:
    if (_global.frame == "home")
    {
        _root.content.gotoAndStop("home");
    }
    if (_global.frame == "about")
    {
        _root.content.gotoAndStop("about");
    }

  3. #3
    Junior Member
    Join Date
    Aug 2009
    Posts
    4
    Thanks so much for the response.

    I don't seem to be understanding, I guess I don't understand the variables.
    I'm wondering if there is a way to do it like this:

    I have done a fade in and fade out for each frame label section, what I can't seem to figure out is how to code a button to tell it to finish playing current scene or section before jumping to the frame label associated with the button.

    So if you are currently on the _home page and you click the contact button I want to play current scene (_home) (for the fade out) and then gotoAndPlay(_contact) (that fades in)

    It is not the entire page that fades in and out just a graphic on each page, the background and everything else stays the same

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