13
Creating Scenes Creating Scenes A scene in flash contains one or more A scene in flash contains one or more layers that show related objects, in the layers that show related objects, in the stage, that act and interact to deliver a stage, that act and interact to deliver a certain idea. certain idea. ر ه ض ت ل ر ث ك او ا ة ق ب ط ن م ن و ك ت ي اش ل ف ل ا ي فاحد و لد ا ه ش م ل ا ر ه ض ت ل ر ث ك او ا ة ق ب ط ن م ن و ك ت ي اش ل ف ل ا ي فاحد و لد ا ه ش م ل ا ة ن ي ع م رة ك6 فل ا ص يا ل ل ع ا ف ب ل وال ع ف ل ا ا هد ي عل ة ل ح ر م ل ا ة هد ي ف ة ل ص ات ذام س ج لا ا ان ة ن ي ع م رة ك6 فل ا ص يا ل ل ع ا ف ب ل وال ع ف ل ا ا هد ي عل ة ل ح ر م ل ا ة هد ي ف ة ل ص ات ذام س ج لا ا ان When creating a flash file, it will have When creating a flash file, it will have one scene by default (named as Scene 1). one scene by default (named as Scene 1). د ت ع د ت عد ه ش م مة سوا( ي ضا ر ث فد ا ه ش م ن و ك ت س اش ل فء ا س ن ا ف ل مء ا س ن اد ه ش م مة سوا( ي ضا ر ث فد ا ه ش م ن و ك ت س اش ل فء ا س ن ا ف ل مء ا س ن ا1 1 ) ) A created movie can have one or more A created movie can have one or more scenes. scenes. ر كث هد اوا ش م ي عل ويZ ت ح ي ان ن ك م ي ج ت ن م ل ا لاش ف ل م ا ل ت ف ر كث هد اوا ش م ي عل ويZ ت ح ي ان ن ك م ي ج ت ن م ل ا لاش ف ل م ا ل ت ف To insert a new scene into your movie: To insert a new scene into your movie: د ه ش م ذراج ا ل د ه ش م ذراج ا ل م ل ت ف ي عل د دي ح م ل ت ف ي عل د دي ح Go to (insert Go to (insert scene) in the flash menubar. scene) in the flash menubar.

Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Embed Size (px)

Citation preview

Page 1: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Creating ScenesCreating Scenes

A scene in flash contains one or more layers A scene in flash contains one or more layers that show related objects, in the stage, that act that show related objects, in the stage, that act and interact to deliver a certain idea.and interact to deliver a certain idea. المشهد المشهد

ان لتضهر اكثر او طبقة من يتكون الفالش في ان الواحد لتضهر اكثر او طبقة من يتكون الفالش في الواحدوالتفاعل الفعل هذا على المرحلة هذه في صلة ذات والتفاعل االجسام الفعل هذا على المرحلة هذه في صلة ذات االجسام

معينة فكرة معينة اليصال فكرة اليصال When creating a flash file, it will have one scene When creating a flash file, it will have one scene

by default (named as Scene 1).by default (named as Scene 1). انشاء ملف انشاء انشاء عند ملف انشاء عندمشهد ) واسمه افتراضي مشهد سيكون مشهد ) فالش واسمه افتراضي مشهد سيكون ((11فالش

A created movie can have one or more scenes.A created movie can have one or more scenes. اواكثر مشهد على يحتوي ان يمكن المنتج الفالش اواكثر فيلم مشهد على يحتوي ان يمكن المنتج الفالش فيلم To insert a new scene into your movie:To insert a new scene into your movie: جديد مشهد جديد الدراج مشهد الدراج

فيلم فيلم على على Go to (insert Go to (insert scene) in the flash menubar. scene) in the flash menubar.

Page 2: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Creating ScenesCreating Scenes

To delete and rename a scene in your movie:To delete and rename a scene in your movie: Go to (WindowGo to (WindowDesign PanelsDesign PanelsScene) in Scene) in

menubarmenubar Or, Shift + F2Or, Shift + F2 Then a new panel (scene) will be displayed. Using Then a new panel (scene) will be displayed. Using

it, you can delete , rename, duplicate existing it, you can delete , rename, duplicate existing scenes.scenes.

, اعادة لحذف تستخدم ان يمكن تظهر التي الجديدة الوحة اعادة , من لحذف تستخدم ان يمكن تظهر التي الجديدة الوحة منالمشهد , نسخ المشهد , تسمية نسخ .. تسمية

You also can insert a scene using it.You also can insert a scene using it. مشهد الضافة ايضا نستخدمها ان مشهد ويمن الضافة ايضا نستخدمها ان ويمن

Duplicateطيق نسخة

لالصل

insert delete

Page 3: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

ActionScript in flashActionScript in flash ActionScript is a way to communicate with a ActionScript is a way to communicate with a

program.program. الفالش برنامج مع للتواصل طريقة الفالش هي برنامج مع للتواصل طريقة هي you can use it to tell Flash what to do and to ask you can use it to tell Flash what to do and to ask

Flash what is happening as a movie runsFlash what is happening as a movie runs. . ان ان يمكنك يمكنك ) ( مالذي الفالش تحدد وتسال فعله تريد مالذي للفالش ) ( تقول مالذي الفالش تحدد وتسال فعله تريد مالذي للفالش تقول

الفيلم هذا تشغل عندما الفيلم سيحدث هذا تشغل عندما سيحدث This twoThis two--way communication lets you create way communication lets you create

interactive moviesinteractive movies.. من يمكنك االتجاهين في االتصال من هذا يمكنك االتجاهين في االتصال هذاالتفاعلية االفالم التفاعلية انتاج االفالم انتاج

ActionScript is the code statements you write to ActionScript is the code statements you write to interacts with flash program.interacts with flash program. كود هي سكربت كود اكشن هي سكربت اكشن

الفالش برنامج مع خاللها من ليتفاعل تكتب الفالش بيانات برنامج مع خاللها من ليتفاعل تكتب بيانات ActionScript can be added to frames or some flash ActionScript can be added to frames or some flash

objects (such as buttons)objects (such as buttons) لالطارات تضاف ان يمكن لالطارات اكشن تضاف ان يمكن اكشن) ( ) ( االزرار مثل الكائنات االجسام (او ( ) ( االزرار مثل الكائنات االجسام او

Page 4: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

ActionScript in flashActionScript in flash

To open the (Actions) panel in which you To open the (Actions) panel in which you can add ActionScript:can add ActionScript: لتتمكن االكشن لوحة لتتمكن لفتح االكشن لوحة لفتح

االكشن اضافة االكشن من اضافة (من (الكود) الكود)

Go to (WindowGo to (Window Development Development PanelsPanelsActions) in menubarActions) in menubar

Or, press F9Or, press F9 The following slides shows the different parts The following slides shows the different parts

that compose the Action panel.that compose the Action panel. تظهر التالية تظهر الشرائح التالية الشرائحاالكشن لوحة منها تتكون المختلفة االكشن االجزاء لوحة منها تتكون المختلفة االجزاء

Page 5: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Actions PanelActions Panel

Add action script code

here

Built-in functionalities

جاهزة اقترانات

Objects and frames that hold actionscriptالكائن

التي واالطر اتبها يمسك يتحكماالكشن

The object or frame that holdsThe written action script الكائنات او االطر

االكشن عليها ويكتب بها يمسك التي

Page 6: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Creating a button symbolCreating a button symbol

Button symbol is used to perform some Button symbol is used to perform some action when pressing on it.action when pressing on it. الرمز الرمز الزر الزر

عليه تضغط عندما االجراءات بعض الداء عليه يستخدم تضغط عندما االجراءات بعض الداء يستخدم To create a button symbol:To create a button symbol:

1.1. Create new flash fileCreate new flash file2.2. Draw a rectangle then select it.Draw a rectangle then select it.3.3. Convert it to a Convert it to a buttonbutton symbol, call this symbol, call this

symbol (myButton)symbol (myButton) This can be done by selecting the shape and This can be done by selecting the shape and

pressing F8pressing F8

4.4. Now, select the button (myButton) and press Now, select the button (myButton) and press F9 to display the action script of it.F9 to display the action script of it.

Page 7: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Creating a button symbolCreating a button symbol

5.5. Write action script as follows:Write action script as follows:

Symbol name

To print on output window(The code to be

executed)

Means that the the code in { }

will be executed when

pressing myButton

Page 8: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Creating a button symbolCreating a button symbol

6.6. On the Stage, double-click the logo button that you created On the Stage, double-click the logo button that you created to view the button Timeline (to enter symbol-editing to view the button Timeline (to enter symbol-editing mode).mode). خط لعرض انشائته الذي الزر على مرتين اضغط المسرح خط على لعرض انشائته الذي الزر على مرتين اضغط المسرح على) للزر ) التحرير على لتدخل للزر (الزمن للزر ) التحرير على لتدخل للزر الزمن The button Timeline contains the following statesThe button Timeline contains the following states: :

Up : the button state when it is not pressedUp : the button state when it is not pressed غندما الزر غندما حالة الزر حالةعليه ضغط عليه اليكون ضغط اليكون

Over : the button state when the mouse is over itOver : the button state when the mouse is over it عندما عندما حالته حالتهعليه الفارة عليه تمون الفارة تمون

Down : the button state when it is pressedDown : the button state when it is pressed الضغط عند الضغط حالته عند حالتهعليهعليه

7.7. Change the Up, Over, and Down state by inserting a key Change the Up, Over, and Down state by inserting a key frame and changing the color on each one.frame and changing the color on each one. حالة في حالة لتغيير في ,Up, Up لتغييرOver, and DownOver, and Down وحدة كل عند لون ونغير وحدة كل مفتاحيعند اطار وحدة نضيف كل عند لون ونغير وحدة كل مفتاحيعند اطار نضيف

8.8. Click Scene 1, above the upper left side of the Stage, to exit Click Scene 1, above the upper left side of the Stage, to exit symbol-editing mode for the button. symbol-editing mode for the button. المشهد على المشهد اضغط على في في 11اضغط

للزر التحرير من لتخرج المسرح من العلوي الشمالي للزر الجانب التحرير من لتخرج المسرح من العلوي الشمالي الجانب

Page 9: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Using Timeline functionsUsing Timeline functions

Some useful timeline functions that controls Some useful timeline functions that controls playhead movement in a Timeline :playhead movement in a Timeline : خط اقترانات خط بعض اقترانات بعض

الزمن خط في البالي حركة في التحكم في المفيدة الزمن الزمن خط في البالي حركة في التحكم في المفيدة الزمن stop();stop();

It is used to stop the playhead and stop the movie It is used to stop the playhead and stop the movie playing.playing. الفيلم تشغيل وايقاف البالي اليقاف الفيلم تستخدم تشغيل وايقاف البالي اليقاف تستخدم

1.1. play();play(); It is used to resume the movie after stopping it.It is used to resume the movie after stopping it. العادة العادة تستخدم تستخدم

ايقافه بعد الفيلم ايقافه تشغيل بعد الفيلم تشغيل

2.2. nextFrame(); nextFrame(); It is used to advance to the next frameIt is used to advance to the next frame للتقدم للتقدم تستخدم تستخدم

) التالي) االطار الى ( االنتقال التالي) االطار الى االنتقال

3.3. prevFrame();prevFrame(); It is used to return to the previous frameIt is used to return to the previous frame االطار الى االطار للرجوع الى للرجوع

السابقالسابق

Page 10: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Using Timeline functionsUsing Timeline functions

1.1. nextScene();nextScene(); It is used to advance to the next scene.It is used to advance to the next scene. المشهد الى المشهد لالنتقال الى لالنتقال

التاليالتالي

2.2. prevScene();prevScene(); It is used to return to the previous sceneIt is used to return to the previous scene المشهد الى المشهد للرجوع الى للرجوع

السابقالسابق

3.3. gotoAndStop(gotoAndStop(scene_namescene_name, , frame_noframe_no);); It moves the playhead to the scene (scene_name) at frame It moves the playhead to the scene (scene_name) at frame

number (frame_no) and stops there.number (frame_no) and stops there. لالطار هيد البالي لالطار لتحريك هيد البالي لتحريكهناك والتوقف حددته الذي المشهد في حددته هناك الذي والتوقف حددته الذي المشهد في حددته الذي

1.1. Scene_name should be enclosed by “” Scene_name should be enclosed by “” يكون ان يجب المشهد يكون اسم ان يجب المشهد اسمبينبين

2.2. Frame_no should be an integer.Frame_no should be an integer. صحيح عدد يكون ان يجب المشهد صحيح اسم عدد يكون ان يجب المشهد اسم gotoAndPlay(gotoAndPlay(scene_namescene_name, , frame_noframe_no); );

1.1. The same as previous function without stoppingThe same as previous function without stopping االقتران االقتران نفس نفسالتوقف بدون ولكن التوقف السابق بدون ولكن السابق

Page 11: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Using Timeline functionsUsing Timeline functions

Ex) This example shows how to use timeline functions.Ex) This example shows how to use timeline functions.

1.1. Create a new flash file. Create a new flash file.

2.2. Rename the scene to “firstScene”Rename the scene to “firstScene”

3.3. Select Frame 1 of layer 1. Select Frame 1 of layer 1.

4.4. In the Actions panel , verify that Frame 1 is In the Actions panel , verify that Frame 1 is selected.selected. االطار االختيار من االطار تاكد االختيار من 11تاكد

5.5. Click in the Script pane of the Actions panel, and Click in the Script pane of the Actions panel, and type type stop(); stop(); to add the stop action.to add the stop action.

To verify that Frame 1 is selected

Page 12: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

Using Timeline functionsUsing Timeline functions

6.6. Create a new scene and name it Create a new scene and name it “newScene”“newScene”

7.7. In scene “newScene” draw a circle and In scene “newScene” draw a circle and make it moves from one place to another.make it moves from one place to another.

8.8. In the Action panel of the last frame of In the Action panel of the last frame of “newScene” add (stop();) command“newScene” add (stop();) command

9.9. Return to the first scene, add a button in Return to the first scene, add a button in the stage and type the following statement the stage and type the following statement to the action panel of that button:to the action panel of that button:gotoAndPlay(“newScene”,1);gotoAndPlay(“newScene”,1);

10.10. Test the sceneTest the scene

Page 13: Creating Scenes A scene in flash contains one or more layers that show related objects, in the stage, that act and interact to deliver a certain idea

ExerciseExercise

Make a flash program that shows the steps Make a flash program that shows the steps needed to learn the subtraction process.needed to learn the subtraction process. See the file (subtraction.swf)See the file (subtraction.swf) You have to use a button to transfer from step You have to use a button to transfer from step

to another. to another. الالزمة الخطوات يوضح فالش برنامج الالزمة يقدم الخطوات يوضح فالش برنامج يقدم . الطرح عملية . لتعلم الطرح عملية لتعلم

الصورة الصورة انظر ( (subtractionsubtraction..swfswf)) انظرأخرى إلى خطوة من االنتقال زر استخدام عليك أخرى يتعين إلى خطوة من االنتقال زر استخدام عليك ..يتعين