flash 调用 脚本

tech2024-05-09  73

flash 调用 脚本

Download the sample files here.

在此处下载示例文件 。

1. Create any object of your choice, and convert it to a movie clip.

1.创建您选择的任何对象,然后将其转换为影片剪辑。

2. Give it an instance name of "child1".

2.为其指定实例名称“ child1”。

3. Right click the movie clip and insert these actions:

3.右键单击影片剪辑并插入以下操作:

onClipEvent (load) {   spring = false;   startX = _x;   startY = _y;   spX = 0;   spY = 0;   }   onClipEvent (mouseDown)   {   startDrag ("", true);   spring = true;   }   onClipEvent (mouseUp)   {   stopDrag ();   spring = false;   }   onClipEvent (enterFrame)   {   //!spring = if false   if (!spring)   {   //code to create the movements   spX += (startX-_x);   spY += (startY-_y);   spX *= .4;   spY *= .4;   _x += spX;   _y += spY;   }   }

5. The script is finished. Press ctrl+enter to test the movie.

5.脚本完成。 按ctrl + enter测试影片。

翻译自: https://www.sitepoint.com/flash-script-spring-effect/

flash 调用 脚本

最新回复(0)