Adobe 65036570 - Director - PC User Manual page 214

User guide
Hide thumbs Also See for 65036570 - Director - PC:
Table of Contents

Advertisement

When the Director script receives the myDirectorScript message, the movie executes the movie-level Director
script handler and jumps to the frame specified in the handler.
Set up a script statement for execution at the sprite/Behavior level
In Flash, specify a script statement to be sent to a behavior attached to the Flash sprite that the script message is
sent from.
To specify the statement, specify the word event, followed by a colon, followed by the script statement that you
want the behavior to execute.
For example, in Flash, you could specify the following statement as the URL parameter of the getURL function:
event: alertMessageReceived
In Flash, the ActionScript would look as follows:
getURL("event:alertMessageReceived");
When Director receives the getURL message from the Flash sprite, the Director movie immediately executes the
script statement.
Sending script statements with arguments
It is possible to send more complicated script statements. Sending handlers with arguments or sending arguments
that contain double quote characters takes more effort to make sure that the script statement is properly formed.
Suppose you have a Director handler in a movie script that adds two numbers and presents an alert with the sum, as
follows:
on addTwoNumbers number1, number2
myResult = number1 + number2
_player.alert(string(myResult))
end
To pass arguments to this script (
getURL("lingo:addTwoNumbers 100, 200");
If the arguments are strings, escape the double quote characters by using a backslash character on each double quote
character that you want to be passed through to Director. For example, if you want to send a script statement from
the Flash sprite that directs Director to launch a browser and open adobe.com, you would do the following:
getURL("lingo:gotonetpage(\"http://www.adobe.com\")");
It might be easier to fabricate the script statement in a temporary variable inside the Flash method and then use
getURL on that variable, as follows:
var theString = getURL("lingo:gotonetpage(\"http://www.adobe.com\")");
getURL(theString);
Additionally, you may want to send the value of a Flash variable as part of the script statement. For example, if
in Flash represents an Adobe product such as Director (
myFlashVar
you could form a script statement as follows in your Flash script:
var theString = getUrl("lingo:gotonetpage(\"http://www.adobe.com/software/" + myFlashVar +
"\")");
getURL(theString);
The resulting URL would be "http://www.adobe.com/software/director" and would be passed to the browser
through Director's
goToNetPage
and
), include the following statement in your Flash ActionScript:
number1
number2
command.
myFlashVar="director"
ADOBE DIRECTOR 11.0
User Guide
in ActionScript),
203

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director 11

Table of Contents