Additional Features - Page 2
October 29, 2001
There are Clip Actions that can assign actions directly to a
movie clip that sits on the Stage. The onClipEvent
action allows for actions like data,
mouseMove, enterFrame, and as simple as
load actions. But some of the obviously most interesting things
for previous ActionScript users are going to be the new actions
that have been presented in version 5. These include actions for
MovieClip objects including getBounds,
attachMovie, hitTest,
swapDepths and others. You can also now use other
actions such as 'do… while' and 'for'
to create complex loops inside of the Flash file.
Of course with all of these changes you want to be better
prepared to handle the errors that are going to be inevitably
created. That is where the Debugger comes in handy. It
allows you to view and change the variables or property values in
either a movie that is playing in test mode, the stand-alone
Flash player or — better yet — a Web-based browser.
Using the debugger helps to find and prevent problems inside the
ActionScript. Another new feature that will perhaps make some of
the new developers a little nervous are the smart clips that have
been introduced in this version. They are internal scripts that
are changed without using the Actions panel. You can pass values
to a Smart Clip through clip parameters, which are actually
define in the library.
Finally, one of the best added features to the ActionScript
language is the ability to convert ActionScript to XML-based
documents and actually convert them to server-side applications.
There is an embedded XML socket that can create a continuous
connection to the server and pass XML data for real-time
applications.
As we previously mentioned, when you write a script you do so
inside of the ActionScript panel. This panel allows you to attach
the script to a frame on either the main Timeline, a Timeline
inside of a Movie Clip, or a button or movie clip that is on the
Stage. In Normal mode you create the actions for the event by
selecting the one that applies from a menu that is on the left
side of the panel, which is called the Toolbox list. This
contains the Basic Actions, Actions, Operators, Properties,
Functions, and Objects categories. The Basic Actions are only
available in Normal Mode and contain the simplest actions. You
can easily add, delete or change the order of these statements,
while at the same time enter in parameters for actions in the
parameter field that will be viewable at the bottom of the panel.
There are also controls that allow you to delete or change the
order of the statements, which are especially useful for managing
frame or button actions when there are a lot of different
statements.
While the Normal mode is great for a majority of users, once you
begin to feel more comfortable with the ActionScript and the
application itself you can eventually move on to the Expert mode.
In this mode the ActionScript is entered directly into the text
box on the right-hand side of the panel. At the same time you can
also select the Actions from the left-hand side. Here you edit
the Actions, enter the parameters, or make deletions in the text
box, which is much similar to creating scripts in a text editor
like Notepad.
To change the mode that you work in, select the Normal or Expert
mode from the pop-up menu that is on the upper right-hand corner
of the Actions panel. Although the Expert mode gives you a lot of
editing ability, there is even a way to take it one step further:
You can have the ActionScript in an external file by using the
include command. For example, this would import the script into
the Flash file: #include "outsidefile.as". The text
file must be present when the Flash movie is being exported.
Okay, I am sure that you would like to do some more reading about
ActionScript but perhaps we should do some hands-on stuff that
you could use now and then learn more in the future!
Introducing ActionScript
Flash 5 Tutorial: Part 1
Hands-On Stuff - Page 3
|