130 likes | 325 Views
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. When creating a flash file, it will have one scene by default (named as Scene 1). A created movie can have one or more scenes.
E N D
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. • When creating a flash file, it will have one scene by default (named as Scene 1). • A created movie can have one or more scenes. • To insert a new scene into your movie: • Go to (insert scene) in the flash menubar.
Creating Scenes • To delete and rename a scene in your movie: • Go to (WindowDesign PanelsScene) in menubar • Or, Shift + F2 • Then a new panel (scene) will be displayed. Using it, you can delete , rename, duplicate existing scenes. • You also can insert a scene using it. duplicate insert delete
ActionScript in flash • ActionScript is a way to communicate with a program. • you can use it to tell Flash what to do and to ask Flash what is happening as a movie runs. • This two-way communication lets you create interactive movies. • ActionScript is the code statements you write to interacts with flash program. • ActionScript can be added to frames or some flash objects (such as buttons)
ActionScript in flash • To open the (Actions) panel in which you can add ActionScript: • Go to (Window Development PanelsActions) in menubar • Or, press F9 • The following slides shows the different parts that compose the Action panel.
Actions Panel Add action script code here Built-in functionalities Objects and frames that hold actionscripts The object or frame that holds The written action script
Creating a button symbol • Button symbol is used to perform some action when pressing on it. • To create a button symbol: • Create new flash file • Draw a rectangle then select it. • Convert it to a button symbol, call this symbol (myButton) • This can be done by selecting the shape and pressing F8 • Now, select the button (myButton) and press F9 to display the action script of it.
Creating a button symbol • Write action script as follows: Means that the the code in { } will be executed when pressing myButton To print on output window (The code to be executed) Symbol name
Creating a button symbol • On the Stage, double-click the logo button that you created to view the button Timeline (to enter symbol-editing mode). • The button Timeline contains the following states: • Up : the button state when it is not pressed • Over : the button state when the mouse is over it • Down : the button state when it is pressed • Change the Up, Over, and Down state by inserting a key frame and changing the color on each one. • Click Scene 1, above the upper left side of the Stage, to exit symbol-editing mode for the button.
Using Timeline functions • Some useful timeline functions that controls playhead movement in a Timeline : • stop(); • It is used to stop the playhead and stop the movie playing. • play(); • It is used to resume the movie after stopping it. • nextFrame(); • It is used to advance to the next frame • prevFrame(); • It is used to return to the previous frame
Using Timeline functions • nextScene(); • It is used to advance to the next scene. • prevScene(); • It is used to return to the previous scene • gotoAndStop(scene_name, frame_no); • It moves the playhead to the scene (scene_name) at frame number (frame_no) and stops there. • Scene_name should be enclosed by “”. • Frame_no should be an integer. • gotoAndPlay(scene_name, frame_no); • The same as previous function without stopping
Using Timeline functions Ex) This example shows how to use timeline functions. • Create a new flash file. • Rename the scene to “firstScene” • Select Frame 1 of layer 1. • In the Actions panel , verify that Frame 1 is selected. • Click in the Script pane of the Actions panel, and type stop(); to add the stop action. To verify that Frame 1 is selected
Using Timeline functions • Create a new scene and name it “newScene” • In scene “newScene” draw a circle and make it moves from one place to another. • In the Action panel of the last frame of “newScene” add (stop();) command • Return to the first scene, add a button in the stage and type the following statement to the action panel of that button: gotoAndPlay(“newScene”,1); • Test the scene
Exercise • Make a flash program that shows the steps needed to learn the subtraction process. • See the file (subtraction.swf) • You have to use a button to transfer from step to another.