MACROMEDIA DIRECTOR MX-USING DIRECTOR MX Use Manual page 307

Table of Contents

Advertisement

Setting up callbacks
The next step is to set up callback handlers with the
up a callback for each event you expect the object to generate. Local connection objects generate
and
onStatus
allowDomain
These incoming message events are named by the string that is passed as the subject, or first
parameter, of the message.
To set up each callback, use the
connection object, the name of the event to respond to, the Lingo handler name, and the Lingo
script object that contains the handler as arguments with the command.
To set up localConnection callbacks:
Set up the
1
onStatus
by the local connection object and contains information about the success or failure of the
send operation.
sprite(1).setCallback(pLocalConn, "onStatus", #myOnStatus, me)
This Lingo statement sets a callback for the event named
. The Lingo handler name is
pLocalConn
contains it is the same script object that contains this
. Note the quotes around the event name and the pound sign (#) preceding the handler
me
name. The pound sign converts the handler name to a symbol.
The actual callback handlers, such as the
this section.
Set up the
2
allowDomain
connection object receives an incoming message.
sprite(1).setCallback(pLocalConn, "allowDomain", #myAllowDomain, me)
In this case, the event name is
If the
myAllowDomain
domain, an event named with the message subject is generated. When a movie is running from
a user's computer and not in a browser, the domain is
in a browser, the domain is determined by the server that hosts the movie, such as
macromedia.com. For more information about allowing domains, see the Flash
Communication Server MX documentation.
Set up the callback for these user-defined messages. Decide what string you want to use as your
3
message subjects, so that you know what the event name will be. In the following example, the
user-defined message subject and event name are
sprite(1).setCallback(pLocalConn, "incomingMessage", #myIncomingMessage, me)
events, as well as an event for each incoming message received.
setCallback()
callback. An
onStatus
myOnStatus
myOnStatus
callback. An
allowDomain
AllowDomain
handler determines that the message is coming from an allowed
command. You should set
setCallback()
command and include the name of the local
event is generated each time a message is sent
onStatus
and the Lingo script object that
setCallback()
handler, are illustrated later in
event is generated each time the local
and the handler name is
. When the movie is running
localHost
incomingMessage
Using Flash and Other Interactive Media Types 307
generated by the object
command, referred to as
.
myAllowDomain
:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DIRECTOR MX-USING DIRECTOR MX and is the answer not in the manual?

This manual is also suitable for:

Director mx

Table of Contents