![MACROMEDIA FLASH 8-FLASH Скачать руководство пользователя страница 239](http://html2.mh-extra.com/html/macromedia/flash-8-flash/flash-8-flash_tutorials-manual_3348958239.webp)
Add navigation to return to Scene 1 239
Link a button to a scene
Now that the playhead stops at Frame 1, you’ll add ActionScript that takes
the user to Scene 2 upon releasing the goScene_btn instance.
■
Press Enter (Windows) or Return (Macintosh) twice and type the
following comment. Then write the function that takes users to
Scene 2 upon release of the goScene_btn instance:
// This script takes the user to Scene 2 when goScene_btn
// is released.
goScene_btn.onRelease = function (){
gotoAndStop("Scene 2", 1);
};
In the script that you just typed, you used the
onRelease()
method
for the button object. The
gotoAndStop()
function is a timeline
control function that lets you specify the scene and frame number. In
this case, you specified Frame 1.
Add navigation to return to
Scene 1
The function that you’ll add to the button in Scene 2, to return the user to
Scene 1, is similar to the function that you wrote to take the user to
Scene 2.
1.
In the Scene panel, select Scene 2.
In the Timeline, create a new layer and name it
Actions
.
2.
Select Frame 1 of the Actions layer.
In the Actions panel, enter the following in the Script pane:
// function takes user to Scene 1 when back_btn instance
// is released
back_btn.onRelease = function (){
gotoAndStop("Scene 1", 1);
};
The only differences between this function and the function in Scene 1
are the name of the button and the name of the scene.
3.
In the Scene panel, select Scene 1.
Содержание FLASH 8-FLASH
Страница 1: ...Flash Tutorials...
Страница 10: ...10 Contents...
Страница 12: ...12 Introduction...
Страница 42: ...42 Basic Tasks Creating a banner Part 1...
Страница 78: ...78 Basic Tasks Creating a banner Part 3...
Страница 88: ...88 Basic Tasks Create Accessible Flash Content...
Страница 106: ...106 Basic Tasks Create an Application...
Страница 116: ...116 Basic Tasks Use Layout Tools...
Страница 124: ...124 Basic Tasks Create Symbols and Instances...
Страница 134: ...134 Basic Tasks Add Button Animation and Navigation...
Страница 144: ...144 Basic Tasks Create a Presentation with Screens Flash Professional Only...
Страница 192: ...192 Creating Graphics Applying Gradients...
Страница 198: ...198 Creating Graphics Apply Graphic Filters and Blends Flash Professional Only...
Страница 224: ...224 ActionScript Use Script Assist mode...
Страница 268: ...268 ActionScript Work with Objects and Classes...
Страница 270: ...270 Data Integration Overview Flash Professional Only...