Download presentation
Presentation is loading. Please wait.
Published bySherman Townsend Modified over 9 years ago
1
Dr.Al-Mothana Gasaymeh
2
Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة
3
How do you create buttons? ارسم شكل اختاره Modify>convert to symbol لاحظ شكل الماوس
4
Button
5
Animated buttons Any thoughts ….
6
Sound in buttons How can you do it? Do not forget to use sync
7
Invisible buttons Example : map, human body Use the hit key frame
8
action script تعليمات يكتبها المبرمج و ينفذها فلاش تكتب في action panel Windows>action or f9
9
Action panel
10
Frame action حاول ان تجعل layer مستقلة ل action script يكتب actionscrpit code على keyframe نختار frame ثم نكتب الكود
11
Frame action دائما نضع هذا الكود في اول key frame stop();
12
Button action
16
Example 1:Rotation by 10 degree on (keyPress " ") { ball._rotation +=10 }
17
Example 2: change Location on (Press ) { ball._x +=10 }
18
Example 3: drag__AS2 square_mc.onPress = function() {square_mc.startDrag(); }; square_mc.onRelease = function() {square_mc.stopDrag(); };
19
Example 4: Timeline control on (press) { gotoAndStop (20); }
20
Numbers in AS2 لتعريف رقم : var Num:Number = 0; رقم عشوائي بين 0 و 6 Math.floor(Math.random() * 7); العمليات الرياضية addition (+), subtraction (-), multiplication (*), division (/), modulo (%), increment (++), and decrement (--).
21
Exercise:Calculator var Num3:Number = 0; addme.onPress =function () { c.text= (Number (a.text) +Number (b.text)); }
22
Movie Clip Properties _alpha Transparency level _height Physical height, in pixels (of instance, not original symbol) _name Clip's identifier, returned as a string _rotation Angle of rotation (in degrees) _visible Boolean indicating whether movie clip is displayed _width Physical width, in pixels (of instance, not original symbol)
23
Movie Clip Properties _x Horizontal position, in pixels, from the left of the Stage _xmouse Horizontal location of the mouse pointer in the clip's coordinate space _xscale Horizontal size, as a percentage of the original symbol (or main timeline for movies) _ y Vertical position, in pixels, from the top of the Stage _ ymouse Vertical location of the mouse pointer in the clip's coordinate space _ yscale Vertical size, as a percentage of the original symbol (or main timeline for movies)
24
Movie Clip Methods gotoAndPlay( ) Moves the playhead to a new frame and plays the movie gotoAndStop( ) Moves the playhead to a new frame and halts it there NextFrame( ) Moves the playhead ahead one frame play( ) Plays the clip prevFrame( ) Moves the playhead back one frame startDrag( ) Causes the instance or movie to physically follow the mouse pointer around the Stage stop( ) Halts the playback of the instance or movie stopDrag( ) Ends any drag operation currently in progress
25
Another way to listen to Keyboard keyListener1 = new Object(); keyListener1.onKeyDown = function() { if (Key.isDown(88)) { a._x+=10; } }; Key.addListener(keyListener1);
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.