![MACROMEDIA FLASH 8-FLASH Скачать руководство пользователя страница 266](http://html2.mh-extra.com/html/macromedia/flash-8-flash/flash-8-flash_tutorials-manual_3348958266.webp)
266 ActionScript: Work with Objects and Classes
8.
In the ActionScript file that you just created, create a new class and
constructor called
Drag
:
class Drag extends MovieClip
{
function Drag ()
{
onPress=doDrag;
onRelease=doDrop;
}
}
9.
Define private methods in the class that use the existing movie clip
methods,
startDrag()
and
stopDrag()
:
class Drag extends MovieClip
{
function Drag()
{
onPress=doDrag;
onRelease=doDrop;
}
private function doDrag():Void
{
this.startDrag();
}
private function doDrop():Void
{
this.stopDrag()
}
}
10.
Save the ActionScript file.
11.
Test the Shape.fla file.
You should be able to drag the movie clip.
NO
TE
An example of the ActionScript file you just created, named Drag.as, is
located in your finished files folder. For the path, see
“Set up your
workspace” on page 256
.
Содержание 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...