25
Dr.Al-Mothana Gasaymeh

Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Embed Size (px)

DESCRIPTION

How do you create buttons? ارسم شكل اختاره Modify>convert to symbol لاحظ شكل الماوس

Citation preview

Page 1: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Dr.Al-Mothana Gasaymeh

Page 2: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Buttonsتسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع االزرار في طبقة مستقلة

Page 3: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

How do you create buttons? ارسم شكلاختارهModify>convert to symbol الحظ شكل الماوس

Page 4: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Button

Page 5: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Animated buttons Any thoughts ….

Page 6: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Sound in buttons How can you do it?

Do not forget to use sync

Page 7: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Invisible buttons Example : map, human body Use the hit key frame

Page 8: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

action scriptتعليمات يكتبها المبرمج و ينفذها فالش تكتب فيaction panel Windows>action or f9

Page 9: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Action panel

Page 10: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Frame action حاول ان تجعلlayer مستقلة ل action script يكتبactionscrpit code على keyframe نختارframe ثم نكتب الكود

Page 11: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Frame action دائما نضع هذا الكود في اولkey frame

stop();

Page 12: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Button action

Page 13: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Button action

Page 14: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Button action

Page 15: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Button action

Page 16: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Example 1:Rotation by 10 degreeon (keyPress "<Backspace>"){ ball._rotation +=10}

Page 17: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Example 2: change Location on (Press ){ ball._x +=10}

Page 18: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Example 3: drag__AS2 square_mc.onPress = function() {square_mc.startDrag(); }; square_mc.onRelease = function() {square_mc.stopDrag(); };

Page 19: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Example 4: Timeline controlon (press){gotoAndStop (20);}

Page 20: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Numbers in AS2لتعريف رقم:

var Num:Number = 0 ; 6 و0رقم عشوائي بين

Math.floor(Math.random() * 7) ;العمليات الرياضية

addition (+), subtraction (-), multiplication (*), division (/), modulo (%), increment (++), and

decrement .)--(

Page 21: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Exercise:Calculator var Num3:Number = 0; addme.onPress =function () { c.text= (Number (a.text) +Number (b.text)); }

Page 22: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

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)

Page 23: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

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)

Page 24: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

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

Page 25: Dr.Al-Mothana Gasaymeh. Buttons تسخدم لخلق تفاعل بين المستخدم و البرنامج دائما ضع الازرار في طبقة مستقلة

Another way to listen to KeyboardkeyListener1 = new Object();keyListener1.onKeyDown = function() { if (Key.isDown(88)) { a._x+=10;} };Key.addListener(keyListener1);