Your First Six Actions Flash

So, now that you have a general picture of what actions do, let’s look at the first six in detail (the remaining actions are covered later). At this point, we’re only describing the functionality of each action, not how to add an action to your movie. As they appear in the Flash interface, the actions are coincidentally sorted from top to bottom roughly according to their complexity. Let’s take it from the top.

Go To
The Go To action changes the current frame of the movie to the target frame specified in the Go To settings. The Go To action has two variations:

  • Go to and Stop: Changes the current frame to the frame specified and then halts playback. Go to and Stop is often used to produce toolbar-style interfaces where the user clicks buttons to view different areas of content in a movie.
  • Go to and Play: Changes the current frame to the frame specified, and then executes a Play Action. Like Go to and Stop, Go to and Play can be used to create toolbar interfaces, but provides the capability to show animated intro sequences as preludes to individual content areas. Go to and Play also gets frequent use in choose-your-own-adventure style animations, in which the user guides an animated character through different paths in a narrative. Note that Go to and Stop is the default type of Go To action. To create a Go to and Play action, you must first add a Go To action, and then check the Go to and Play option in the Parameters area of the Actions Panel. Each Go To action enables you to jump to certain areas of the Flash movie. The parameters of the Go To actions start with the largest time unit, the Scene, and end with the smallest one, the Frame.

You can specify frames in other scenes as the target of Go To actions with the Scene parameter. In the Scene drop-down menu, you can find a list of all the scenes in your movie, as well as built-in references to <current scene>, <next scene>, and <previous scene>, as shown below. The Scene drop-down can be used together with the Type and Frame parameters to target a frame in any Scene in a movie.

Setting the Go To action that targets a specific Scene.

Setting the Go To action that targets a specific Scene.

There are five methods of specifying the frame to which the movie should go when it receives a Go To action. You set the method by selecting the appropriate Type and Frame parameters. After you’ve chosen the method to use to refer to your target frame, enter or select the frame’s name or number under that setting’s options .

Setting the Go To action with a Frame Number type.

Setting the Go To action with a Frame Number type.

The methods for specifying the frame are:

  • Number: Specify the target frame as a number. Frame 1 is the beginning of the movie or scene. Number spans scenes, so if you have a movie with two scenes, each containing 25 frames, and you add a Go to action with Frame Number set to 50, your action advances the movie to the 25th frame of the second scene.
  • Label: Individual keyframes can be given names via the Label text field in the Frame panel. Once a frame is labeled, a Go To action can target it by name. To specify a label as the target of a Go To action, select Frame Label in the Type drop-down menu. Then either type the name of the frame into the Frame text field, or select it from the automatically generated list of frame labels in the Frame drop-down menu as seen below.
  • Setting the Go To action with a Frame Label.

    Setting the Go To action with a Frame Label.

  • Expression: Specify the target frame as an interpreted ActionScript code segment. Expressions are used to dynamically assign targets of Go To actions.
  • Next Frame: Specify the target frame as the frame after the current frame. Next Frame can be used in conjunction with Previous Frame to quickly set up a slide-show-style walkthrough of content, where each of a series of contiguous keyframes contains the content of one “slide.”
  • Previous Frame: Specify the target frame as the frame before the current frame.

Play
This simple action is one of the true foundations of Flash. Play sets a movie or a Movie Clip in motion. When a Play action is executed, Flash starts the sequential display of each frame’s contents along the current timeline. The rate at which the frames are displayed is measured as frames per second, or fps. The fps rate can be set from 0.01 to 120 (meaning that the Play Action can cause the display of as little as 1 frame every 100 seconds to as many as 120 frames in 1 second, subject to the limitations of the computer’s processing speed). The default fps is 12. Once Play has started, frames continue to be displayed one after the other, until another action interrupts the flow, or the end of the movie or Movie Clip’s timeline is reached. If the end of a movie’s timeline is reached, the movie either loops (begins playing again at frame 1, scene 1), or stops on the last frame. If the movie is set to loop, once the end of the Movie Clip’s timeline is reached, playback loops back to the beginning of the clip, and the clip continues playing. To prevent looping, add a Stop action to the last frame of your Movie Clip.

Stop
Stop, as you may have guessed, halts the progression of a movie or Movie Clip that is in a Play state. Stop is often used with buttons for user-controlled playback of a movie, or on frames to end an animated sequence.

Toggle High Quality
Here’s a straightforward action that changes the entire movie’s visual rendering quality setting to High if it is currently set at Low, and to Low if it is currently set at High. In High-Quality Mode, the edges of lines and text appear smooth because they are antialiased (or blurred slightly between shifts in color). In Low-Quality Mode, the edges of lines and text appear choppy because they are not antialiased. Low Quality is occasionally set on movies that are played back on slower computers because it causes animation to play back more quickly. See the difference for this toggle setting in Figure below. Toggle High Quality is considered a deprecated action because of the new Flash 5 _quality and _highquality properties. All quality settings are global, which means that every timeline (including Movie Clip timelines) will be affected regardless of where the action is executed.

Low Quality (left) versus High Quality (right)

Low Quality (left) versus High Quality (right)

Stop All Sounds
A simple but powerful action that mutes any sounds playing in the movie at the time the action is executed. Stop All Sounds does not disable sounds permanently it simply cancels any sounds that happen to be currently playing. It is sometimes used as a quick-and-dirty method of making buttons that shut off background looping soundtracks. Stop All Sounds is not appropriate for controlling whether multiple sounds are played or muted.

Get URL
Want to link to a Web page from a Flash movie? No problem. That’s what Get URL is for. Get URL is simply Flash’s method of making a conventional hypertext link. It’s nearly exactly the equivalent of an Anchor tag in HTML, except that Flash’s Get URL also allows for form submission. Get URL can be used to link to a standard Web page, an ftp site, another Flash movie, an executable, a CGI script, or anything that exists on the Internet or on an accessible local file system. Get URL has three parameters that are familiar to Web builders (the first one, URL, is required for this Action to work):

  • URL: This is the network address of the page, file, script, or resource to which you are linking. Any value is permitted (including ActionScript expressions), but the linked item can only be displayed if the reference to it is correct. URL is directly analogous to the HREF attribute of an HTML Anchor tag. You can use a relative or absolute URL as well.
  • Since Flash 4, Get URL can now link to documents on the Web from the standalone Flash player. Execution of a Get URL action in the standalone player causes an external Web browser to launch and load the requested URL .

    Setting the URL of a Get URL action

    Setting the URL of a Get URL action

  • Window: This is the name of the frame or window in which you wish to load the resource specified in the URL setting. Window is directly analogous to the TARGET attribute of an HTML Anchor tag. In addition to enabling the entry of custom frame and window names, Window provides four presets in a dropdown menu:
    • _self: Loads the URL into the same frame or window as the current movie.
    • _blank: Creates a new browser window and loads the URL into it.
    • _parent: Removes the current frameset and loads the URL in its place.Use this option if you have multiple nested framesets, and you want your linked URL to replace only the frameset in which your movie resides.
    • _top: Loads the URL into the current browser and removes all framesets in the process. Use this option if your movie is in a frame, but you want your linked URL to be loaded normally into the browser, outside the confines of any frames.
  • Variables: This option enables Get URL to function like an HTML form submission.

For normal links, the Variables setting should be left at its default value, Don’t Send. But in order to submit values to a server-side script, one of the submission methods (Send Using GET or Send Using POST) must be selected.

Although this focuses on using Basic Actions, you should start familiarizing yourself with the ActionScript notation that Flash uses for each action . As you use Flash for more advanced interactivity, you’ll need to have a firm grasp of code notation. Part V, “Programming Flash Movies with ActionScript,” teaches you how to start building code from the ground up.

Basic actions and actionscript notation

Basic actions and actionscript notation


Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Flash Topics