Sending Xml Data From Flash To Director; Using Flash Objects In Script - MACROMEDIA DIRECTOR MX 2004-USING DIRECTOR Use Manual

Hide thumbs Also See for DIRECTOR MX 2004-USING DIRECTOR:
Table of Contents

Advertisement

Sending XML Data from Flash to Director

You can send XML data from a Flash sprite or object to a script.
To send XML data from a Flash sprite or a global Flash object to a script:
On the Flash side, use the
1
The
XMLobject
On the Director side, include an
2
This handler takes the same parameters as the
on sendXML me, URL, targetWindow, xmlData
The
xmlData
add script to the handler to process the XML data. A common action is to send the XML data
to the URL and await the response of the server located at the URL, as in this example:
on sendXML me, URL, targetWindow, xmlData
gotoNetPage(URL, targetWindow)
postNetText(URL, xmlData)
end

Using Flash objects in script

With Director, you can create Flash ActionScript objects and access all of their properties and
methods. You can create a wide variety of Flash objects, including arrays, dates, Booleans, XML
objects, and net connection objects for use with Macromedia Flash Communication Server MX.
If you have authored Flash content that contains ActionScript classes that generate custom
objects, you can access those objects in script as well. You can also create references to existing
ActionScript objects with the
these objects, see
When creating Flash objects, you can choose to create an object within a Flash sprite, or you can
create a global Flash object.
To create a Flash object within a Flash sprite, you must have Flash content in the cast and a
Flash sprite on the Stage. Do not use a Flash cast member created with the method
new(#Flash)
data. When you create a Flash object within a sprite, the object uses the same instance of the
Flash Player that Director loads when the Flash cast member appears on the Stage.
In your script, use the
create requires parameters, include them with the
myNewFlashObject = sprite(1).newObject("Array", "apple", "orange", "banana")
In this example, the specified sprite,
(In Lingo, arrays are called lists.) The array contains three strings:
and
"banana"
To create a global Flash object, use the
you do this, Director loads a special instance of the Flash Player into memory. This way, you
can use Flash objects without the need for a Flash cast member or sprite.
In your script, use the
myNewFlashObject = newObject("Array", "apple", "orange", "banana")
XMLobject
.
method has a URL and a
send
on sendXML
parameter is the XML data contained in the original XMLObject. You can then
getVariable()
"Using Lingo or JavaScript syntax to set and test Flash variables" on page
, as this creates a Flash cast member shell, which contains no actual internal Flash
newObject()
.
newObject()
.
ActionScript method.
send
targetWindow
handler in your script to handle rhe XML data.
.
XMLobject
send
method. For more information about accessing
method with a sprite reference. If the object you want to
newObject()
, is the Flash sprite. The object is an array.
sprite(1)
method without a sprite reference. When
newObject()
method without a sprite reference:
parameter.
method, as follows:
method:
,
"apple"
"orange"
Using Flash objects in script
189.
,
193

Advertisement

Table of Contents
loading
Need help?

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

This manual is also suitable for:

Director mx 2004

Table of Contents