This same
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 attached
to a movie clip object, statements made within an
which the
on()
For example, the following
handler is attached, not the Timeline that contains the movie clip.
on(press) {
stop();
}
The same conditions apply to
instance, 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(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
getURL()
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, just as you would when targeting a window with an HTML anchor (
For example, the following code opens the macromedia.com home page in a blank browser
window when the user clicks the button instance named
homepage_btn.onRelease = function () {
getURL("http://www.macromedia.com", _blank);
}
You can also send variables along with the URL, using
are loading from an application server, like a ColdFusion Server (CFM) page, expects to receive
form variables. For example, suppose you want to load a CFM page named addUser.cfm that
expects two form variables,
that defines those two variables, as shown below.
variables_mc
variables_mc.name = "Francois";
variables_mc.age = 32;
The following code then loads addUser.cfm into a blank browser window and passes to the CFM
page
variables_mc.name
variables_mc.getURL("addUser.cfm", "_blank", "POST");
For more information, see
event handler code will produce a different result when attached to a movie clip
handler is attached.
handler code stops the Timeline of the movie clip to which the
on()
onClipEvent()
global function or the
and
name
age
and
variables_mc.age
on page
getURL()
handler are applied to the movie clip to
on()
handlers attached to movie clip objects. For
MovieClip.getURL()
homepage_btn
or
GET
POST
. To do this, you could create a movie clip named
in the
POST
394.
Controlling SWF file playback
onClipEvent()
method. For example,
<a></a>
.
. This is useful if the page you
header.
on()
) tag.
93
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?
Questions and answers