![MACROMEDIA FLASH 8-FLASH Скачать руководство пользователя страница 232](http://html2.mh-extra.com/html/macromedia/flash-8-flash/flash-8-flash_tutorials-manual_3348958232.webp)
232 ActionScript: Write Scripts
Copy and modify a button
function
You just created one function that sets the
visible
property of a movie
clip to
true
when the user releases the mouse button after a button click.
You can probably guess how to create another function that hides the
screen_mc
movie clip: by setting the movie clip
_visible
property to
false
when the user clicks an Off button. You’ll create that function now.
1.
In the Script pane, select the entire function that you just typed,
including the comment, curly brackets, and semicolon. Copy the text as
you normally would, using C (Windows) or C
(Macintosh).
2.
In the Script pane, place the insertion point after the last line of code.
Then press Enter (Windows) or Return (Macintosh) twice, and paste
the text as you normally would, using V (Windows) or
V (Macintosh).
3.
In the copied function, change the text in
onButton_btn
to read
offButton_btn
.
Remember, earlier you assigned an instance name of
offButton_btn
to an instance.
4.
In the copied function, change the
visible
property of the
screen_mc
movie clip from
true
to
false
.
5.
In the copied function, change the commented text after the slashes to
read
function to hide animation
.
Your entire script should appear as follows:
// Initialize document to hide screen movie clip.
this.screen_mc._visible = false;
// function to show animation
this.onButton_btn.onRelease = function(){
screen_mc._visible = true;
};
// function to hide animation
this.offButton_btn.onRelease = function(){
screen_mc._visible = false;
};
Содержание 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...