MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 905

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

This code specifies the URL of the XML file and sets
It triggers the XMLConnector instance three times, which causes the event listener's
method to display the error code
first attempt is successfully sent from Flash to the server. When the first trigger successfully
receives a result, the
Output panel.
XMLConnector.URL
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
componentInstance.URL
Description
Property; the URL that this component uses when carrying out HTTP operations. This URL
may be an absolute or relative URL. The URL is subject to all the standard Flash Player
security protections.
Example
This example retrieves a remote XML file using the XMLConnector component by setting the
property to
direction
enter the following code on Frame 1 of the Timeline:
import mx.data.components.XMLConnector;
var xmlListener:Object = new Object();
xmlListener.result = function(evt:Object) {
trace("results:");
trace(evt.target.results);
trace("");
};
xmlListener.status = function(evt:Object) {
trace("status::"+evt.code);
};
var myXMLConnector:XMLConnector = new XMLConnector();
myXMLConnector.addEventListener("result", xmlListener);
myXMLConnector.addEventListener("status", xmlListener);
myXMLConnector.direction = "receive";
myXMLConnector.URL = "http://www.flash-mx.com/mm/tips/tips.xml";
myXMLConnector.multipleSimultaneousAllowed = false;
myXMLConnector.suppressInvalidCalls = true;
myXMLConnector.trigger();
myXMLConnector.trigger();
myXMLConnector.trigger();
CallAlreadyInProgress
event is broadcast and the XML packet you receive is displayed in the
result
. Drag an XMLConnector component into your library, and
receive
multipleSimultaneousAllowed
two times in the Output panel. The
XMLConnector component (Flash Professional only)
to
.
false
status
905

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx

Table of Contents