Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2003
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Action Script Help in Macromedia

    I recently just starting learning Flash and i think it's great. I have Macromedia Flash MX 2004, and i'm trying to do a project for school. I'm doing pretty good in it so far except for the fact that i can't get buttons to work. I have three buttons which link to three different scenes. On release, i want the buttons to do two different things. I put a stop() command in on
    around frame 230, but when the button's clicked, i want it to play the rest of the scene which is just a fade out. Then, of course, i want it to go to the scene indicated by the button. I've been able to get it partly to work, but i'm not too familiar with action script and I can't get all parts of it to work. Could somebody provide me some insight on how to do this? Thanks.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,058
    Thanks
    10
    Thanked 96 Times in 94 Posts
    set a variable say _root.where_now , in the button action
    so eg for the button that links to scene_1

    Code:
    on release{
      _root.where_now = scene_1 ;
      gotoAndPlay(230);
    }
    now in the frame that your fadeout ends, add an action

    Code:
    gotoAndPlay(_root.where_now,1) ;
    e.g. use the variable you set onclick to decide which frame to goto ... if my syntax is back to front I apologise, setting the variable as at the root seems to stop most variable scoping issues.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

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