dr.al-mothana gasaymeh. buttons تسخدم لخلق تفاعل بين المستخدم و...
DESCRIPTION
How do you create buttons? ارسم شكل اختاره Modify>convert to symbol لاحظ شكل الماوسTRANSCRIPT
Dr.Al-Mothana Gasaymeh
Buttonsتسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع االزرار في طبقة مستقلة
How do you create buttons? ارسم شكلاختارهModify>convert to symbol الحظ شكل الماوس
Button
Animated buttons Any thoughts ….
Sound in buttons How can you do it?
Do not forget to use sync
Invisible buttons Example : map, human body Use the hit key frame
action scriptتعليمات يكتبها المبرمج و ينفذها فالش تكتب فيaction panel Windows>action or f9
Action panel
Frame action حاول ان تجعلlayer مستقلة ل action script يكتبactionscrpit code على keyframe نختارframe ثم نكتب الكود
Frame action دائما نضع هذا الكود في اولkey frame
stop();
Button action
Button action
Button action
Button action
Example 1:Rotation by 10 degreeon (keyPress "<Backspace>"){ ball._rotation +=10}
Example 2: change Location on (Press ){ ball._x +=10}
Example 3: drag__AS2 square_mc.onPress = function() {square_mc.startDrag(); }; square_mc.onRelease = function() {square_mc.stopDrag(); };
Example 4: Timeline controlon (press){gotoAndStop (20);}
Numbers in AS2لتعريف رقم:
var Num:Number = 0 ; 6 و0رقم عشوائي بين
Math.floor(Math.random() * 7) ;العمليات الرياضية
addition (+), subtraction (-), multiplication (*), division (/), modulo (%), increment (++), and
decrement .)--(
Exercise:Calculator var Num3:Number = 0; addme.onPress =function () { c.text= (Number (a.text) +Number (b.text)); }
Movie Clip Properties_alphaTransparency level_heightPhysical height, in pixels (of instance, not original symbol)_nameClip's identifier, returned as a string_rotationAngle of rotation (in degrees)_visibleBoolean indicating whether movie clip is displayed_widthPhysical width, in pixels (of instance, not original symbol)
Movie Clip Properties_xHorizontal position, in pixels, from the left of the Stage_xmouseHorizontal location of the mouse pointer in the clip's coordinate space_xscaleHorizontal size, as a percentage of the original symbol (or main timeline for movies)_ yVertical position, in pixels, from the top of the Stage_ ymouseVertical location of the mouse pointer in the clip's coordinate space_ yscaleVertical size, as a percentage of the original symbol (or main timeline for movies)
Movie Clip MethodsgotoAndPlay( )Moves the playhead to a new frame and plays the moviegotoAndStop( )Moves the playhead to a new frame and halts it thereNextFrame( )Moves the playhead ahead one frameplay( )Plays the clipprevFrame( )Moves the playhead back one framestartDrag( )Causes the instance or movie to physically follow the mouse pointer around the Stagestop( )Halts the playback of the instance or moviestopDrag( )Ends any drag operation currently in progress
Another way to listen to KeyboardkeyListener1 = new Object();keyListener1.onKeyDown = function() { if (Key.isDown(88)) { a._x+=10;} };Key.addListener(keyListener1);