A method of realizing the jump between flash scenes

Source: Internet
Author: User

In the production of Flash animation, there may be a very big MC, sometimes put it into a few scenes, then in the scene of the jump how to achieve it? Take a look at the tutorial.

  Method One: (using the Telltarget command)

The As on the button is:

On (release) {
Telltarget ("/") {
gotoAndPlay ("Scene 1", 1);
}
}

  Method two (with gotoandplay command)

The MC in main scene 2 is placed on the timeline of the scene 2 button as:

On release {
gotoAndPlay ("Scene 1", 1)
}

And in the last frame with the Stop (), the problem can be solved.

Method three (using the path _root.gotoandplay ())

In the second scene 2 there is only one MC, at the last frame of this MC is the stop and a replay button
As:_root.gotoandplay of buttons (1)
"That tells the button to return to the first frame of scene 1."

  Method Four (give a different name to the scene)

If you write as this:
There is only one MC in the second sence, the last frame of this MC is the AS: Stop and a replay button button.

On release {
gotoAndPlay ("Sence1", 1)

The result is that it starts playing from the first frame of the MC, not from the first frame of the Sence1.
This is because the name of the main scene defaults to Sencen
MC can also have multiple scenes, and the MC is the default for Sencen

So when you use gotoAndPlay ("Scene1", 1) on the MC, it refers to the first frame in the MC in the scene, not the main scene.

The solution is to define different names for the scene scene1 we renamed it: the main scene, Scene2 we renamed it: Sub Scene 1.

The correct as should be:

On (release) {
Telltarget (_root) {
gotoAndPlay (1);
}
}

If you want to implement the button click to play from the second scene can be written on the button:

On (release) {
Telltarget (_root. Second scene) {
gotoAndPlay (1);
}
}

  Method five (using label labels)

When we control the animation is not usually from the beginning of the play, may be from a scene to start a key frame, then the label is the best way to achieve;

For example, when you click on the button above to let the animation play from the Label1 in the main scene, the as on the button should be:

On (release) {
Telltarget (_root) {
gotoAndPlay ("Label1");
}

For example there are 3 scenes, we want to click on the button above to let the animation from the Label4 in the second scene 1 play, then the button on the as should be:

On (release) {
Telltarget (_root) {
gotoAndPlay ("Sub Scene 1", "label4");
}
}

If you want to implement the button click to play from the second scene
You can write on the button:

On (release) {
Telltarget (_root. Second scene) {
gotoAndPlay (1);
}
}



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.