
在这里想教大家弄一个可爱的 Robot仔按钮。眼睛会 Random 的动。 Mouse Over 时会有表情。
难度:Beginner-Intermediate
(一)
Dimension: 100 x 100 pixels
Background: white
FPS: 48
先画 Robot仔的身体。

(二)
选 Insert -> New Symbol 或 Ctrl+F8

在 Create New Symbol Dialogue Box 里面,打 robot_off。在 Behaviour Type 选 Graphics。按 OK。
这是给 Mouse Off (滑鼠没有在 Button 上面)时的 Robot仔表情。

跟着就会去到 robot_off 的 working environment 里面。在这里贴上 Robot仔的身体。(可以回到 Main scene copy 再 paste Robot仔的身体)。

(三)
现在我们要弄一个会自己转的眼睛。
再 Insert New Symbol,打 robot_eye,behaviour 选 Movie。
现在我们会在 robot_eye 的 working environment里面。
在这里,画一个圆圈。这是眼睛的外线。Rename this layer as "outer"
Insert new layer。Rename as "inner"
在 layer "inner" 里面画一个黑珠子。这是眼黑。先把它画在左边(看左)

现在我们把两个 Layer 都加 frame 加到 180 个 frame。
在 layer "inner" 的第 24个 frame,我们 Insert Keyframe,在把黑珠子改成一条直线。(眨眼)

在 layer "inner" 的第 24个 frame,我们 Insert Keyframe,再画同样的黑珠子。这次我们把它 Move 到比较右边(看右)。

现在 Right Click on frame 24-> Copy Frame。然后 paste 在 frame 49。
在 Frame 50 insert blank keyframe,画眼珠在中间。(看直)

跟着读者可以随便在一个 Frame 里面在加 Keyframe。然后在画眼珠看上,看下,看斜,眨眼 等等。。。
现在再 Create New Layer, Rename as "Action"。
在 Layer "Action" 的最后一个 Frame,也是 Frame 180 ,加入 Actionscript。输入:
gotoAndPlay (random ( 180 ));

这个 scripts 的功能就是 randomly play any part of the frames。
OK! 现在我们 create 了眼睛。我们回到 Robot_off 的 working environment 里面,然后 drag robot_eye 进去。

这样一来, Robot_off 完成了。
(四)
现在要作 Robot_on 的表情了。
Create new symbol -> type in robot_on
Behaviour: Movie
第一个 Layer 我们 paste 上 robot 的身体。加 frame 到 65。
Create new layer,这时候我们就用 Frame-by-frame 的技术来画 robot 的眼睛会闭着,然后转动。

参考如下:
>>转动的眼睛<<
这样一来,我们就完成 robot_on 了。
(五)
现在我们要作 Robot_down,也就当我们按滑鼠键的时候的表情。
Insert new symbol-> Type in "robot_down"
Behavior : Graphics
在 Robot_down working environment 里面我们画上一个被按的表情。

就大功告成!
(六)
现在开始作 Button。
Insert new symbol-> Type in "robot_button".
Behaviour : Button。
在 Robot_button 的 working environment 的 frame "UP" 里面,放入 Robot_off 的 graphic。

在 Frame "On"(Over) 里面放 Robot_on 的 movie clip。稍微 rotate 一点(+5 degree)。

在 Frame "Down" 放 Robot_down 的 graphic。

在 Frame "Hit" 将 Robot 的范围涂黑它。。。

(七)
现在回到 main scene,把 Robot_button drag 进来。再写上 "Click me" 的字眼。就大功告成了~!!!

完成品:
>>Robot<<
FLA file:
>>Click here to download<<
No comments:
Post a Comment