About Events And Interaction; Controlling Swf File Playback - MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

About events and interaction

Whenever a user clicks the mouse or presses a key, that action generates an event. These types
of events are generally called user events because they are generated in response to some action
by the user. You can write ActionScript to respond to, or handle, these events. For example,
when a user clicks a button, you might want to send the playhead to another frame in the
SWF file or load a new web page into the browser.
In a SWF file, buttons, movie clips, and text fields all generate events to which you can
respond. ActionScript provides three ways to handle events: event handler methods, event
listeners, and
and
on()
handling events, see
Chapter 10, "Handling Events."

Controlling SWF file playback

The following ActionScript functions let you control the playhead in the timeline and load a
new web page into a browser window:
The
gotoAndPlay()
scene. These are global functions that you can call from any script. You can also use the
MovieClip.gotoAndPlay()
timeline of a specific movie clip object. See
The
and
play()
movie clips" on page
The
action jumps to a different URL. See
getURL()
on page
564.
For more information, see the following topics:
"Jumping to a frame or scene" on page 562
"Playing and stopping movie clips" on page 563
"Jumping to a different URL" on page 564
Jumping to a frame or scene
To jump to a specific frame or scene in the SWF file, you can use the
global functions or the equivalent
gotoAndStop()
MovieClip.gotoAndStop()
you specify a frame to jump to in the current scene. If your document contains multiple
scenes, you can specify a scene and frame where you want to jump.
562
Creating Interaction with ActionScript
handlers. For more information about events and
onClipEvent()
and
gotoAndStop()
and
MovieClip.gotoAndStop()
actions play and stop SWF files. See
stop()
563.
methods of the MovieClip class. Each function or method lets
functions send the playhead to a frame or
methods to navigate the
"Jumping to a frame or scene" on page
"Playing and stopping
"Jumping to a different URL"
MovieClip.gotoAndPlay()
562.
and
gotoAndPlay()
and

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents