what I'm trying to do is have it so when you click on a button, it will play a certain animation I have created, and then go to a certain part of the site. I want to have this animation play every time someone presses one of these buttons, but i don't want to copy the animation over to each section. Is it possible to have one button go and play an animation, and then go to a different section of the site?
ok, but if I did that, would that mean I would have to create multiple animations, each one taking you to a different section of the site, depending on which button you pressed? If so, what I want to do is have it so each button will place that animation, but after the animation is done it will take you to a certain section. I'm just wondering if it's possible to do this without creating multiple animations?
oh ok, and how do I define a section within my Flash Movie? And does the animation need to be a movie clip? Because right now it is just part of my main movie.
you can either just set _root.section to be the frame number you need to go to, or you can give the start of each section a frame label, and set _root.section to the names you have used as the frame labels.
Hey Ice,
Are you getting confused by _root nomenclature?..Which is actually a systematic way.
Simplest thing would be, inserting one more scene in your movie having the particular animation you want to play after buttons get clicked. Now all your buttons could lead to the new scene assumning name "section".(or if you dont give name, it would be scene number, dont forget quotes!)
on (release) {
gotoAndPlay("section", 1);
}
Do not also forget giving a script piece to last frame of the new scene in order to get back to the main scene or wherever (specific frame number/label in main scene, any other scene,or replaye the same..blah blah)you want to go.
Yes, but wouldn't doing it that way cause me to create multiple scenes of the same animation, each one having a different gotoAndPlay(); command at the end?
You are setting a _root variable called section. This variable contains the section name you want to go to. You WON'T be going to a section called "section", this is just what the variable is called.
I've attached an example file for you. You should be able to work out what is happening from this.
Take a look at all the actions, including the buttons, and the _root function called viewSection.
You need to understand what functions are, how they work, and how to use them. They are VITAL to good scripting. Understanding how variables work is THE MOST IMPORTANT THING in scripting.
(the file attached is not the best way of doing this, its pretty clumsy, but you should be able to understand it)
Last edited by findShorty; 09-01-2003 at 07:33 PM.
Great Shorty!!I also downloaded the file, it's not clumsy at all. Pretty explanatory!! I had not understood Ice's problem at the first place, But still wont have been able to explain the solution so well.
I had been thinking of getting the same work done with conditional "if" statement at the last frame of 'animation' in order to take to different sections??? What do you think about it?
I agree, I am making it complicated when it can be done in a simple way....But usually do so just to get a grip on action script.