MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 564

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

This same
event handler code produces a different result when attached to a movie clip
on()
object rather than a button. When attached to a button object, statements made within an
handler are applied to the timeline that contains the button, by default. However, when
on()
attached to a movie clip object, statements made within an
movie clip to which the
For example, the following
which the handler is attached, not the timeline that contains the movie clip:
// Attached to the myMovie_mc movie clip instance
myMovie_mc.onPress() {
stop();
};
The same conditions apply to
example, the following code stops the timeline of the movie clip that bears the
handler when the clip first loads or appears on the Stage:
onClipEvent()
onClipEvent(load) {
stop();
}
Jumping to a different URL
To open a web page in a browser window, or to pass data to another application at a defined
URL, you can use the
example, you can have a button that links to a new website, or you can send timeline variables
to a CGI script for processing in the same way as you would an HTML form. You can also
specify a target window, the same as you would when targeting a window with an HTML
anchor tag (
).
<a></a>
For example, the following code opens the macromedia.com home page in a blank browser
window when the user clicks the button instance named
// Attach to frame
homepage_btn.onRelease = function () {
getURL("http://www.macromedia.com", "_blank");
};
564
Creating Interaction with ActionScript
handler is attached.
on()
handler code stops the timeline of the movie clip to
onPress()
onClipEvent()
global function or the
getURL()
handler are applied to the
on()
handlers attached to movie clip objects. For
MovieClip.getURL()
homepage_btn
method. For
:

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

This manual is also suitable for:

Flash 8

Table of Contents