Sending Xml Data From Flash To Director; Using Flash Objects In Script - Adobe 65036570 - Director - PC User Manual

User guide
Hide thumbs Also See for 65036570 - Director - PC:
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.
1
On the Flash side, use the
The
.
method has a URL and a
XMLobject
send
2
On the Director side, include an
This handler takes the same parameters as the
on sendXML me, URL, targetWindow, xmlData
The
parameter is the XML data contained in the original XMLObject. You can then add script to the
xmlData
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 the following 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 Flash Media Server. 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
getVariable()
JavaScript syntax with Flash
When creating Flash objects, create an object within a Flash sprite or 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
shell that contains no actual internal 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
parameters, include them with the
myNewFlashObject = sprite(1).newObject("Array", "apple", "orange", "banana")
In this example, the specified sprite,
called lists.) The array contains three strings:
To create a global Flash object, use the
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")
The Flash asset commonPlayer feature lets you load multiple Flash sprites into one instance of the Flash Player. This
provides better Flash playback performance in Director objects that have a great deal of Flash assets.
.
ActionScript method.
XMLobject
send
targetWindow
handler in your script to handle the XML data.
on sendXML
XMLobject
method. For more information about accessing these objects, see
variables.
method with a sprite reference. If the object you want to create requires
newObject()
newObject()
, is the Flash sprite. The object is an array. (In Lingo, arrays are
sprite(1)
"apple"
newObject()
method without a sprite reference:
newObject()
parameter.
.
method, as follows:
send
. Doing so creates a Flash cast member
new(#Flash)
method:
,
, and
"orange"
"banana"
method without a sprite reference. When you do this,
ADOBE DIRECTOR 11.0
User Guide
Using Lingo or
.
204

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director 11

Table of Contents