To handle a message string passed by Flash content:
Specify the message string in the Flash content, as described above.
1
For example, in Flash, you could specify the following string as the URL parameter of the
function:
getURL
Hello World
In Flash, the ActionScript would look like this:
getURL("Hello World");
In Director, include an
2
Flash content.
For example, in Director, you could enter the following handler in a movie script:
on getURL me, stringFromFlash
_movie.go("stringFromFlash")
end
When the
on getURL
then jumps to the frame labeled Hello World in the Director Score.
To set up a script statement for execution at the Movie level:
In Flash, specify an event message by specifying the word lingo followed by a colon, the name
1
of a handler you write in Director, and a parameter (if any) to pass with the event.
For example, in Flash, you could specify the following statement as the URL parameter of the
getURL function:
lingo: myDirectorScript
In Flash, the ActionScript would look as follows:
getURL("lingo:myDirectorScript");
Note: Using lingo: with getURL fully supports sending Lingo, not JavaScript, syntax. However,
you can send JavaScript syntax method calls to Director since the syntax for calling a method is
the same syntax as calling Lingo handlers.
In Director, include an event handler to execute the statement passed by the Flash content.
2
For example, in Director, you could write a corresponding handler as follows:
on myDirectorScript
_movie.go("Flash Message Received")
end
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.
To 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 from
which the script message is sent.
You specify the statement by specifying 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
handler to receive and read the string passed by the
on getURL
handler receives the text string ("Hello World"), it reads the string and
Sending messages from Flash content using getURL
191
Need help?
Do you have a question about the DIRECTOR MX 2004-USING DIRECTOR and is the answer not in the manual?
Questions and answers