|
5 600 brands
1 870 000 user's guides |
|
|
|||||||||||||||
|
Search a brand
Advanced Search
|
Our partners wish to propose you the following products
|
User manual MACROMEDIA FLASH MEDIA SERVER 2 - SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE
Diplodocs help download the user guide MACROMEDIA FLASH MEDIA SERVER 2 - SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE.
Preview of the first 3 pages of manual
You either have JavaScript turned off or an old version of Adobe Flash Player Get the latest Flash Player.
User guide MACROMEDIA FLASH MEDIA SERVER 2 - SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE
Detailed instructions for use are in the User's Guide. Server-Side ActionScript Language Reference
Trademarks 1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central, ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite, FlashPaper, Flash Video Encoder, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder, Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit, Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally. Third-Party Information This guide contains links to third-party websites that are not under the control of Macromedia, and Macromedia is not responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia endorses or accepts any responsibility for the content on those third-party sites. SorensonTM SparkTM video compression and decompression technology licensed from Sorenson Media, Inc.
Copyright © 2005 Macromedia, Inc. All rights reserved. This manual may not be copied, photocopied, reproduced, translated, or converted to any electronic or machine-readable form in whole or in part without written approval from Macromedia, Inc. Notwithstanding the foregoing, the owner or authorized user of a valid copy of the software with which this manual was provided may print out one copy of this manual from an electronic version of this manual for the sole purpose of such owner or authorized user learning to use such software, provided that no part of this manual may be printed out, reproduced, distributed, resold, or transmitted for any other purposes, including, without limitation, commercial purposes, such as selling copies of this documentation or providing paid-for support services. Acknowledgments Project Management: Suzanne Smith Writing: Jody Bleyle Editing: Geta Carlson, Mary Ferguson, Mary Kraemer Production and Editing Management: Patrice O'Neill, Rosana Francescato Media Design and Production: Adam Barnett, Aaron Begley, Paul Benkman, John Francis, Mario Reynoso Special thanks to Erick Vera and the Flash Media Server engineering and QA teams. First Edition: October 2005 Macromedia, Inc. 601 Townsend St. San Francisco, CA 94103
Contents
Chapter 1: Server-Side ActionScript Language Reference . . . . . . 5 Using server-side ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Using naming conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 ActionScript classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Global functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 ActionScript elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Application class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 clearInterval(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Client class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 File class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 getGlobal() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 load() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 LoadVars class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 Log class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 NetConnection class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 protectObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 setAttributes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 setInterval() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 SharedObject class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 SOAPCall class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 SOAPFault class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142 Stream class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144 trace() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 WebService class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162 XML class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .166 XMLSocket class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .218 XMLStreams class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Appendix A: Server-Side Information Objects . . . . . . . . . . . . . 229 Application information objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 NetConnection information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . .231 Stream information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
3
4
Contents
CHAPTER 1
Server-Side ActionScript Language Reference
Server-side ActionScript is a scripting language on the server that lets you develop efficient and flexible client-server Macromedia Flash Media Server applications. For example, you can use server-side ActionScript to control log-in procedures, control events in connected Macromedia Flash applications, determine what users see in their Flash applications, and communicate with other servers. You can also use server-side scripting to allow and disallow users access to various server-side application resources and to allow users to update and share information. Server-side ActionScript is based on the ECMA-262 specification (ECMAScript 1.5), which is derived from JavaScript and lets you access the core JavaScript server object model. Serverside ActionScript provides global methods and classes and exposes a rich object model for developing media applications. You can also create classes, properties, and methods. This dictionary provides detailed information about the classes and their properties, methods, and events. Client-side ActionScript is based on the ECMA-262 specification but deviates from the specification in several places. Server-side ActionScript does not deviate from the ECMA-262 specification. For information about the relationship between server-side ActionScript and client-side ActionScript, see Developing Media Applications.
1
Using server-side ActionScript
To use server-side ActionScript with a Flash Media Server application, you write the code, add the script file to the appropriate server directory, and run the SWF file that connects to the server. To understand the architecture of Flash Media Server and its applications, see Developing Media Applications.
5
Create the server-side ActionScript file and name it main.asc. All ActionScript code that is embedded in the script file and not in a function body executes once when the application is loaded but before the application.onAppStart event handler is called.
You can name your server-side ActionScript file app_name, where app_name is the name of your application's directory, and save it with a file extension of .asc or .js. Also, any double-byte characters (including characters of all Asian languages) in the serverside ActionScript file must be UTF-8-encoded. For more information on server-side script files, see Developing Media Applications. For large-scale applications, you may need to use multiple server-side script files. You can use the Flash Media Server archive compiler utility to deploy those files as a package from a single location. For more information, see "Archiving and compiling server-side script files" in Developing Media Applications. Server-side scripts also have a secure loading phase, during which critical code can be loaded before the main application loading phase. Server-side scripts also let you create protected objects; these are objects whose methods and data cannot be inspected or manipulated. These two features allow you to implement system calls that protect critical data and functions. For more information, see "Implementing secure system objects" in
NO TE
To install and test the server-side ActionScript file:
1.
2. 3.
6
NO TE N OT E
Developing Media Applications.
Locate the Macromedia Flash Media Server /applications directory. The default location of the /applications directory is in the Macromedia Flash Media Server product installation directory.
If you did not accept the default installation settings and you aren't sure where the /application directory is located, the location is specified in the AppsDir tag of the Vhost.xml file, which is located at /Flash Media Server /conf/defaultRoot/ defaultVhost. For information about configuring a different application directory, see Managing Flash Media Server. Although your SWF and HTML files should be published under a web server directory, your server-side ASC files, your audio/video FLV files, and your ActionScript FLA source files should not be accessible to a user browsing your website.
N OT E
Your server-side script file must be named main.asc, main.js, registered_app_name.asc, or registered_app_name.js. Create a subdirectory in the /applications directory called appName, where appName is a name you choose as the filename of your Flash Media Server application. You must pass this name as a parameter to the NetConnection.connect() method in the client-side ActionScript.
Server-Side ActionScript Language Reference
4. 5.
Place the main.asc file in the appName directory or in a subdirectory called scripts in the appName directory. Open the Flash application (the SWF file) in a browser or in the stand-alone Flash Player. The SWF file must contain ActionScript code that passes appName to the connect method of the NetConnection class, as shown in the following example:
nc = new NetConnection(); nc.connect("rtmp://flashcomsvr.mydomain.com/myFlashComAppName"); You can use the management console to check if the application loaded successfully.
NO T E
Using naming conventions
When you write server-side ActionScript code, there are certain naming conventions that you must use to name your applications, methods, properties, and variables. These rules let you logically identify objects so your code executes properly.
Naming applications
Flash Media Server application names must follow the Uniform Resource Identifier (URI) RFC 2396 convention. This convention supports a hierarchical naming system where a forward slash (/) separates the elements in the hierarchy. The first element specifies the application name. The element following the application name specifies the application instance name. Each instance of the application has its own script environment.
Specifying instances
By specifying a unique application instance name after an application name, you can run multiple instances of a single application. For example, rtmp:/support/session215 specifies a customer support application named "support" and refers to a specific session of that application named "session215". All users who connect to the same instance name can communicate with each other by referencing the same streams or shared objects.
Using JavaScript syntax
You must follow all syntax rules of JavaScript. For example, JavaScript is case-sensitive and does not allow punctuation other than underscores (_) and dollar signs ($) in names. You can use numbers in names, but names cannot begin with a number.
Using naming conventions
7
Avoiding reserved commands
Flash Media Server has reserved commands that you cannot use in a script. These commands are either methods that belong to the client-side NetConnection class or methods that belong to the server-side Client class. This means that if you have a NetConnection object on the client (player), you cannot make the following call:
nc.call("reservedCmd", ...);
In this call, "reservedCmd" is any of the following commands: closeStream, connect,
createStream, deleteStream, onStatus, pause, play, publish, receiveAudio,
or seek. It also cannot be any of the server-side Client class methods: getBandwidthLimit, setBandwidthLimit, getStats, and ping.
receiveVideo,
ActionScript classes
The following table lists all the classes in the Server-Side ActionScript Language Reference.
ActionScript class
Application class
Description
The Application class contains information about a Flash Media Server application instance that lasts until the application instance is unloaded. The Client class lets you handle each user, or client, connection to a Flash Media Server application instance. The File class lets applications write to the server's file system. The LoadVars class lets you load variables into a server-side script from a remote or local location. The Log class lets you create a Log object that can be passed as an optional argument to the Constructor for the WebService class. The server-side NetConnection class lets you create a two-way connection between a Flash Media Server application instance and an application server, another Flash Media Server, or another Flash Media Server application instance on the same server. The Shared Object class lets you share data between multiple client applications in real time. The SOAPCall class is the object type that is returned from all web service calls. The SOAPFault class is the object type of the error object returned to WebService.onFault and SOAPCall.onFault functions.
Client class File class LoadVars class Log class NetConnection class
SharedObject class SOAPCall class SOAPFault class
8
Server-Side ActionScript Language Reference
ActionScript class
Stream class WebService class XML class XMLSocket class
Description
The Stream class lets you handle each stream in a Flash Media Server application. The WebServices class lets you create and access a WSDL/ SOAP web service. The XML class lets you load, parse, send, build, and manipulate XML document trees. The XMLSocket class implements client sockets that let Flash Media Server communicate with a server identified by an IP address or domain name. The XMLStreams class is a variation of the XMLSocket class. It has all the same methods, properties, and events, but it transmits and receives data in fragments.
XMLStreams class
Global functions
The following table lists all the global functions in the Server-Side ActionScript Language Reference.
Global function
clearInterval()
Description
Cancels a time-out that was set with a call to the setInterval() method. Provides access to the global object while the secure.asc file is loading. Loads an ActionScript file in the main.asc file. Protects user-defined or built-in objects behind a C wrapper object. Lets you prevent certain methods and properties from being enumerated, written, and deleted. Continually calls a function or method at a specified time interval until the clearInterval() method is called. Evaluates an expression and displays the value.
getGlobal()
load() protectObject()
setAttributes()
setInterval()
trace()
Global functions
9
ActionScript elements
Entries in this document are alphabetical by class name and then by method, property, or event handler name. The following table lists all classes, methods, properties, and event handlers individually in alphabetical order.
ActionScript element
acceptConnection addHeader addRequestHeader agent allowDebug appendChild attributes autoCommit broadcastMsg bufferTime call canAppend canRead canReplace canWrite childNodes clear clearInterval clearSharedObject clearStreams clients cloneNode close
See entry
Application.acceptConnection() NetConnection.addHeader() LoadVars.addRequestHeader(), XML.addRequestHeader() Client.agent Application.allowDebug XML.appendChild() XML.attributes SharedObject.autoCommit Application.broadcastMsg() Stream.bufferTime Client.call(), NetConnection.call() File.canAppend File.canRead File.canReplace File.canWrite XML.childNodes SharedObject.clear(), Stream.clear() clearInterval() Application.clearSharedObjects() Application.clearStreams() Application.clients XML.cloneNode() NetConnection.close(), File.close(), SharedObject.close(), XMLSocket.close()
"commandName" commit
Client."commandName" SharedObject.commit()
10
Server-Side ActionScript Language Reference
ActionScript element
config connect contentType copyTo createElement createTextNode creationTime decode detail disconnect docTypeDecl eof exists faultactor faultcode faultstring firstChild flush gc get getBandwidthLimit getBytesLoaded getBytesTotal getNamespaceForPrefix getPrefixForNamespace getProperty getPropertyNames getStats handlerName hasChildNodes
See entry
Application.config NetConnection.connect(), XMLSocket.connect() LoadVars.contentType, XML.contentType File.copyTo() XML.createElement() XML.createTextNode() File.creationTime LoadVars.decode() SOAPFault.detail Application.disconnect() XML.docTypeDecl File.eof() File.exists SOAPFault.faultactor SOAPFault.faultcode SOAPFault.faultstring XML.firstChild File.flush(), SharedObject.flush(), Stream.flush() Application.gc() SharedObject.get(), Stream.get() Client.getBandwidthLimit() LoadVars.getBytesLoaded(), XML.getBytesLoaded() LoadVars.getBytesTotal(), XML.getBytesTotal() XML.getNamespaceForPrefix() XML.getPrefixForNamespace() SharedObject.getProperty() SharedObject.getPropertyNames() Application.getStats(), Client.getStats() SharedObject.handlerName XML.hasChildNodes()
ActionScript elements
11
ActionScript element
hostName ignoreWhite insertBefore ip isConnected isDirectory isDirty isFile isOpen lastChild lastModified length list load loaded localName lock mark mkdir mode name
See entry
Application.hostname XML.ignoreWhite XML.insertBefore() Client.ip NetConnection.isConnected File.isDirectory SharedObject.isDirty File.isFile File.isOpen XML.lastChild File.lastModified File.length, Stream.length() File.list() load(), LoadVars.load(), XML.load() LoadVars.loaded, XML.loaded XML.localName SharedObject.lock() SharedObject.mark() File.mkdir() File.mode Application.name, File.name, SharedObject.name, Stream.name
namespaceURI nextSibling nodeName nodeType nodeValue onAppStart onAppStop onClose
XML.namespaceURI XML.nextSibling XML.nodeName XML.nodeType XML.nodeValue Application.onAppStart Application.onAppStop XMLSocket.onClose
12
Server-Side ActionScript Language Reference
ActionScript element
onConnect onConnectAccept onConnectReject onData onDisconnect onFault onHTTPStatus onLoad onLog onResult onStatus
See entry
Application.onConnect, XMLSocket.onConnect Application.onConnectAccept Application.onConnectReject LoadVars.onData, XML.onData, XMLSocket.onData Application.onDisconnect SOAPCall.onFault, WebService.onFault LoadVars.onHTTPStatus, XML.onHTTPStatus LoadVars.onLoad, WebService.onLoad, XML.onLoad Log.onLog SOAPCall.onResult Application.onStatus, NetConnection.onStatus, SharedObject.onStatus, Stream.onStatus
onSync onXML open parentNode parseXML ping play position prefix previousSibling protocol purge read readAccess readAll readByte readln record
SharedObject.onSync XMLSocket.onXML File.open() XML.parentNode XML.parseXML() Client.readAccess Stream.play() File.position XML.prefix XML.previousSibling Client.protocol SharedObject.purge() File.read() Client.readAccess File.readAll() File.readByte() File.readln() Stream.record()
ActionScript elements
13
ActionScript element
referrer registerClass registerProxy rejectConnection remove removeNode renameTo request __resolve response resyncDepth secure seek send
See entry
Client.referrer Application.registerClass() Application.registerProxy() Application.rejectConnection() File.remove() XML.removeNode() File.renameTo() SOAPCall.request Client.__resolve SOAPCall.response SharedObject.resyncDepth Client.secure getGlobal() LoadVars.send(), SharedObject.send(), Stream.send(), XML.send(), XMLSocket.send()
sendAndLoad server setAttributes setBandwidthLimit setBufferTime setInterval setProperty setVirtualPath shutdown size server status syncWrite toString trace
LoadVars.sendAndLoad(), XML.sendAndLoad() Application.server setAttributes() Client.setBandwidthLimit() Stream.setBufferTime() setInterval() SharedObject.setProperty() Stream.setVirtualPath() Application.shutdown() SharedObject.size(), Stream.size() Application.server XML.status Stream.syncWrite File.toString(), LoadVars.toString(), XML.toString() trace()
14
Server-Side ActionScript Language Reference
ActionScript element
type unlock uri version virtualKey write writeAccess writeAll writeByte writeln xmlDecl
See entry
File.type SharedObject.unlock() NetConnection.uri, Client.uri SharedObject.version Client.virtualKey File.write() Client.writeAccess File.writeAll() File.writeByte() File.writeln() XML.xmlDecl
Application class
Availability
Flash Communication Server 1. The Application class contains information about a Flash Media Server application instance that lasts until the application instance is unloaded. A Flash Media Server application is a collection of stream objects, shared objects, and clients (connected users). Each application has a unique name, and you can use a naming scheme to create multiple instances of an application. For more information about the naming scheme, see "Using naming conventions" on page 7. Every instance of a Flash Media Server application has an application object, which is a single instance of the Application class. You don't need to use a constructor function to create the application object; it is created automatically when an application is instantiated by the server. Use the following syntax to call the methods, properties, and event handlers of the Application class:
application.methodPropertyOrHandler
Use the application object to accept and reject client connection attempts, register and unregister classes and proxies, and create functions that are invoked when an application starts or stops or when a client connects or disconnects. For more information about the life cycle of an application, see "Application flow" in Developing Media Applications.
Application class
15
Besides the built-in properties of the Application class, you can create other properties of any legal ActionScript type, including references to other ActionScript objects. For example, the following code creates a new property of type Array and a new property of type Number:
application.myarray = new Array(); application.num_requests = 1;
Method summary for the Application class
Method
Application.acceptConnection() Application.broadcastMsg()
Description
Accepts a connection to an application from a client. Broadcasts a message to all connected clients. instance.
Application.clearSharedObjects() Clears all shared objects associated with the current
Application.clearStreams()
Clears all stream objects associated with the current instance. Disconnects a client from the server. Invokes the garbage collector to reclaim any unused resources for this application instance. Returns network statistics for the application instance. Registers or unregisters a constructor that is called during object deserialization. Registers a NetConnection or Client object to fulfill a method request. Rejects a connection to an application. Unloads the application instance.
Application.disconnect() Application.gc()
Application.getStats() Application.registerClass()
Application.registerProxy()
Application.rejectConnection() Application.shutdown()
Property summary for the Application class
Property
Application.allowDebug
Description
A Boolean value that lets administrators use the approveDebugSession() Server Management ActionScript method to access your Flash Media Server application (true) or not (false). Read-only; an object containing a list of all clients currently connected to the application.
Application.clients
16
Server-Side ActionScript Language Reference
Property
Application.config
Description
Lets you access properties of the ApplicationObject tag in the Application.xml configuration file. Read-only; the host name of the server for default virtual hosts, and virtual host name for non-default virtual hosts. Read-only; the name of an application instance. Read-only; the platform and version of the server.
Application.hostname
Application.name Application.server
Event handler summary for the Application class
Event handler
Application.onAppStart Application.onAppStop Application.onConnect Application.onConnectAccept
Description
Invoked when the application is loaded by the server. Invoked when the application is unloaded by the server. Invoked when a client connects to the application. Invoked when a client successfully connects to the application; for use with media components only. Invoked when a client fails to connect to the application; for use with communication components only. Invoked when a client disconnects from the application. Invoked when a script generates an error.
Application.onConnectReject
Application.onDisconnect Application.onStatus
Application.acceptConnection()
Availability
Flash Communication Server MX 1.0.
Usage
application.acceptConnection(clientObj)
Parameters
clientObj
A Client object; a client to accept.
Returns
Nothing.
Application class
17
Description
Method; accepts the connection call from a client to the server. The application.onConnect event handler is invoked on the server side to notify a script when NetConnection.connect() is called from the client side. You can use the application.acceptConnection() method in an application.onConnect event handler to accept a connection from a client. You can use the application.acceptConnection() method outside an application.onConnect event handler to accept a client connection that had been placed in a pending state (for example, to verify a user name and password). When you use components and your code includes an explicit call to application.acceptConnection() or application.rejectConnection(), the last line (in order of execution) of the onConnect event handler should be either application.acceptConnection() or application.rejectConnection(). Also, any logic that follows the explicit acceptConnection or rejectConnection statement must be placed in application.onConnectAccept and application.onConnectReject statements, or it will be ignored. This requirement exists only when you use components.
Example
The following example uses the application.acceptConnection() method to accept the connection from client1:
application.onConnect = function (client1){ // Insert code here. application.acceptConnection(client1); client1.call("welcome"); }; This example shows code from an application that does not use components.
NO T E 18
See also
Application.onConnect, Application.rejectConnection()
Application.allowDebug
Availability
Flash Media Server 2.
Usage
application.allowDebug
Server-Side ActionScript Language Reference
Description
Property; a Boolean value that allows Administrators to access your application with the approveDebugSession() Server Management API (true) or not (false). A debug connection displays information about shared objects and streams. For information about creating a debug connection, see NetConnection.connect() and
approveDebugSession().
Application.broadcastMsg()
Availability
Flash Media Server 2.
Usage
application.broadcastMsg(cmd [, p1, p2, ..., pN])
Parameters
cmd p1
A string; a message to broadcast. A string; additional messages.
Returns
Nothing.
Description
Method; broadcasts a message to all connected clients. This method is equivalent to looping through the Application.clients array and calling Client.call() on each individual client, but is more efficient (especially for large number of connected clients). The only difference is that you can't specify a response object when you call broadcastMsg(), otherwise, the syntax is the same. Shared objects can handle broadcast messages with the SharedObject.handlerName property.
Example
The following server-side code sends a message to the client:
application.broadcastMsg("handlerName", "Hello World");
The following client-side code catches the message and prints it in the Output panel:
nc = new NetConnection(); nc.handlerName = function(msg) { trace(msg); } // traces out "Hello World"
Application class
19
See also
SharedObject.handlerName
Application.clearSharedObjects()
Availability
Flash Communication Server MX 1.0.
Usage
application.clearSharedObjects(soPath)
Parameters
soPath
A string that indicates the URI of a shared object.
Returns
A Boolean value of true if the shared object at the specified path was deleted; otherwise, false. If using wildcard characters to delete multiple files, the method returns true only if all the shared objects matching the wildcard pattern were successfully deleted; otherwise, it will return false.
Description
Method; deletes persistent shared objects (FSO files) specified by the soPath parameter and clears all properties from active shared objects (persistent and nonpersistent). The soPath parameter specifies the name of a shared object, which can include a slash (/) as a delimiter between directories in the path. The last element in the path can contain wildcard patterns (for example, a question mark [?] and an asterisk [*]) or a shared object name. The application.clearSharedObjects() method traverses the shared object hierarchy along the specified path and clears all the shared objects. Specifying a slash (/) clears all the shared objects associated with an application instance. The following values are possible for the soPath parameter:
/
clears all local and persistent shared objects associated with the instance.
/foo/bar clears the shared object /foo/bar; if bar is a directory name, no shared objects are deleted. /foo/bar/* clears all shared objects stored under the instance directory /foo/bar. The bar directory is also deleted if no persistent shared objects are in use within this namespace. /foo/bar/XX??
clears all shared objects that begin with XX, followed by any two characters. If a directory name matches this specification, all the shared objects within this directory are cleared.
20
Server-Side ActionScript Language Reference
If this document matches the user guide, instructions manual or user manual, feature sets, schematics you are looking for, download it now. Diplodocs provides you a fast and easy access to the user manual MACROMEDIA FLASH MEDIA SERVER 2 - SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE. MACROMEDIA offer a product for which we do not have the user manual? Let us know what you are looking for: user guide, owner's manual, online manual, operating instructions, quick start guide, mounting instructions, schematics, service manual, installation instructions, RTFM. Diplodocs allows you to download user manual MACROMEDIA FLASH MEDIA SERVER 2 - SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE, user guide MACROMEDIA FLASH MEDIA SERVER 2 - SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE, instructions MACROMEDIA FLASH MEDIA SERVER 2 - SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE, owner's manual MACROMEDIA FLASH MEDIA SERVER 2 - SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE, online manual MACROMEDIA FLASH MEDIA SERVER 2 - SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE.MACROMEDIA FLASH MEDIA SERVER 2 - SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE, , Software. |
![]() |
Include the add-on to download manuals from your site, forum or blog | ![]() |
Frequently Asked Questions | ![]() |
Contact Diplodocs team | ![]() |
Last searches Last additions |
![]() |
Sitemap | ![]() |
|||
| Brands starting with A B C D E F G H I J K L M N O P Q R S T U V W X Y Z # | |||||||||||||
|
|
Copyright © 2005 - 2008 - Diplodocs -
All Rights Reserved. Designated trademarks and brands are the property of their respective owners. |