flash 调用 脚本

tech2024-05-14  78

flash 调用 脚本

Download the sample files here.

在此处下载示例文件 。

1. Open a new movie, and give it a width of 200, a height of 150. Set the background color to black.

1.打开一个新电影,并将其宽度设置为200,高度设置为150。将背景色设置为黑色。

2. Create a new graphic symbol (let’s call it "gr_square") of a square with a height and width of 8 pixels. Choose a color that can be seen against your black background.

2.创建一个高度和宽度为8像素的正方形的新图形符号(我们称之为“ gr_square”)。 选择一种可以在黑色背景下看到的颜色。

3. Create a movieclip symbol (let’s call it "mv_bar"). Drag 6 instances of gr_square into the movieclip. Align them vertically, so that the upper left corner of each square is separated from the one immediately below it by 10 pixels.

3.创建一个动画片段符号(我们将其命名为“ mv_bar”)。 将gr_square的6个实例拖到动画片段中。 垂直对齐它们,以使每个正方形的左上角与其下一个正方形相隔10个像素。

The upper left corner of the topmost square should be at the coordinates x=0, y=0.

最上方正方形的左上角应位于坐标x = 0,y = 0处。

4. Create a new movieclip symbol (let’s call it "mv_LEDbar") with 2 layers. Name the upper layer "LED mask" and the lower layer "LED color". now, drag an instance of mv_bar into the upper layer, and position it at x=0, y=50.

4.创建一个新的带有2层的movieclip符号(我们称其为“ mv_LEDbar”)。 将上层命名为“ LED蒙版”,将下层命名为“ LED色”。 现在,将mv_bar的一个实例拖到上层,并将其放置在x = 0,y = 50处。

5. Add the following movieclip action to the instance of mv_bar.

5.将以下movieclip操作添加到mv_bar实例。

onClipEvent (enterFrame) { indicator = Math.round(Math.random() * 100); if (indicator > 55 && this._y > 5) { this._y -= 10; } else if (indicator < 45 && this._y < 55) { this._y += 10; } }

6. On the bottom layer, draw the following graphic with the dimensions shown here — choose any color you like!

6.在底层,绘制以下图形,并显示此处的尺寸-选择您喜欢的任何颜色!

7. Align the graphic with the mv_bar instance, like this:

7.将图形与mv_bar实例对齐,如下所示:

8. Set the color of the lowest block to black (making it the same color as the movie background).

8.将最低块的颜色设置为黑色(使其与电影背景颜色相同)。

9. Set the properties of layers, making the upper layer a mask, and the lower layer a masked layer.

9.设置层的属性,将上层作为蒙版,将下层作为蒙版层。

10. Go back to Scene 1, and rename Layer 1, "LED". Drag several instances of mv_LEDbar on to the stage. Align the instances as shown here.

10.返回场景1,并将第1层重命名为“ LED”。 将mv_LEDbar的多个实例拖到舞台上。 如此处所示对齐实例。

11. Add a layer above the LED layer, and name it "Frame". Draw a rectangle, then delete the fill color so that you can see the LED instances beneath.

11.在LED层上方添加一个层,并将其命名为“ Frame”。 绘制一个矩形,然后删除填充颜色,以便您可以看到下面的LED实例。

We’re finished! Test the movie and you’ll see your Flash LED display.

我们完成了! 测试电影,您将看到Flash LED显示屏。

翻译自: https://www.sitepoint.com/flash-script-led-display/

flash 调用 脚本

最新回复(0)