1 Reply Latest reply on Oct 7, 2008 6:31 AM by ThemeKings

    actionscript for nav buttons

    Spindrift Level 1
      hi guys,

      how can i set some actions to the buttons in my navigation so that when clicked, it plays an animation. when it gets to the end of this animation i want the movie to play another animation that leads into the next section of the site, depending on which button was clicked.

      so basically if youre in a section of the site (say news), when you select another section to go to (eg. contact), an animation will play that gets rid of all the news stuff on the screen and then comes back in with the contact animation - as to not have a direct cut to the next scene.

      i dont want to make eight or so animations that exit from the news section that have a different gotoAndPlay actions at the end of them. im just hoping there is some actionscript that i can put on each button to tell it what to do and where to go.

      hope ive explained this ok!

      thank you very much and i hope to hear from you.

      all the best,

        • 1. actionscript for nav buttons
          I would create a "movie instance" first of all the animation(s) itself. Make it as long as you like, but in my demo I'm using a movie instance (my animation) of about 15 frames. When someone clicks on a button in my demo here, I use a script that points to the relavant frame in which I want my animation to play: Example ( this script attached to button one, the top button of my nav)

          on (release) {

          In this code its going right to frame #2 when the first button is pressed, as seen in the image below of my example, within the "frame name" layer. I gave the "Frame Label" the name "1". (I kept it simple)

          What that is doing is playing the animation I created (the word "loading" fading in and out) and placed in the "animation" layer that runs from frame #2 to frame #14. Then in the "action" layer, frame 15, I have the "stop" command.


          See an eample of the nav unit at: http://www.themekings.com/themestk/gamers/sectionx/demo.htm

          Its not as animated as you want it to be, but it should give you an idea as what to do.