When creating flash animation, there may be a lot of mc
Sometimes it is put into several scenarios. How can we achieve redirection in the scenario? This may be a problem that beginners often encounter. I checked some information and summarized it:
Method 1: (use the telltarget command)
The as on the button is:
On (release ){
TellTarget ("/"){
GotoAndPlay ("scenario 1", 1 );
}
}
========================================================== ================
Method 2 (use the gotoandplay command)
Mc in main scenario 2 is placed on the timeline of Scenario 2.
As: on release {
GotoAndPlay ("scenario 1", 1)
}
And add stop () to the last frame ()
========================================================== ================================
Method 3 (using path _ root. gotoandplay ())
In scenario 2, there is only one mc, And the last frame of the mc is stop.
And a replay button
As: _ root. gotoAndPlay (1) of the button)
In this way, you can click the button to return to the first frame of scenario 1 to achieve jump between scenarios!
========================================================== ==================
Method 4 (name the scenario differently)
If your as is written as follows:
There is only one mc in the second sence, And the last frame of the mc is the stop button and a replay button.
As: on release {
GotoAndPlay ("sence1", 1)
}
After the result is pressed, it starts playing from the first frame of the mc, rather than from the first frame of sence1.
This is because the name of the main scenario is senceN by default.
MC can also have multiple scenarios, and mc is also the default senceN
So when you use gotoAndPlay ("scene1", 1); In MC, it refers to the first frame in MC,
Not the main scenario
The solution is to define different names for the scenario.
Scene1: Main scenario
Scene2: Scenario 1
The correct as should be:
On (release ){
TellTarget (_ root ){
GotoAndPlay (1 );
}
}
If you want to play the video from the next scene after clicking the button
You can write the following on the button:
On (release ){
TellTarget (_ root. Time scenario ){
GotoAndPlay (1 );
}
}
========================================================== ====================
Method 5 (using label)
When we control an animation, we generally do not play it from the beginning,
The tag is
The best implementation method;
For example, we want to start the animation from label1 in the home scene when we click the button above.
Play, The as on the button should be:
On (release ){
TellTarget (_ root ){
GotoAndPlay ("label1 ");
}
For example, in three scenarios, we want to start the animation from label4 in scenario 1 when we click the button above.
Play, The as on the button should be:
On (release ){
TellTarget (_ root ){
GotoAndPlay ("scenario 1", "label4 ");
}
}
}
}
If you want to play the video from the next scene after clicking the button
You can write the following on the button:
On (release ){
TellTarget (_ root. Time scenario ){
GotoAndPlay (1 );
}
}
You may have many other methods. Experts can make up !!