MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Manuel d'utilisateur

Naviguer en ligne ou télécharger Manuel d'utilisateur pour Serveurs MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY. Server-Side Communication ActionScript Dictionary Macromedia Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 80
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 0
Server-Side Communication
ActionScript Dictionary
Macromedia Flash
Communication Server MX 1.5
Vue de la page 0
1 2 3 4 5 6 ... 79 80

Résumé du contenu

Page 1 - ActionScript Dictionary

Server-Side CommunicationActionScript DictionaryMacromedia Flash™ Communication Server MX 1.5

Page 2

10Method summary for the Application objectProperty summary for the Application object Event handler summary for the Application objectApplication.acc

Page 3 - CONTENTS

Server-Side Communication ActionScript 11ParametersclientObj A client to accept. ReturnsNothing.DescriptionMethod; accepts the connection call from a

Page 4 - APPENDIX

12DescriptionMethod; removes persistent shared objects (FSO files) specified by the soPath parameter and clears all properties from active shared obje

Page 5

Server-Side Communication ActionScript 13DescriptionMethod; clears recorded streams (FLV) files and MP3 files associated with the application instance

Page 6 - Using naming conventions

14The following example clears all MP3 files from the application instance’s /disco subdirectory:function onApplicationStop(){application.clearStreams

Page 7 - Contents of the dictionary

Server-Side Communication ActionScript 15DescriptionMethod; causes the server to terminate a client connection to the application. When this method is

Page 8

16DescriptionProperty (read-only); contains the hostname of the server for default virtual hosts and the virtual hostname for non-default virtual host

Page 9 - Application (object)

Server-Side Communication ActionScript 17ExampleThe following example defines an anonymous function for the application.onAppStart event handler that

Page 10 - Application.acceptConnection

18Application.onConnectAvailabilityFlash Communication Server MX.Usageapplication.onConnect = function (clientObj [, p1, ..., pN]){// insert code here

Page 11

Server-Side Communication ActionScript 19Note: Returning 1 or 0 is not the same as returning true or false. The values 1 and 0 are treated the same as

Page 12 - Application.clearStreams

TrademarksAfterburner, AppletAce, Attain, Attain Enterprise Learning System, Attain Essentials, Attain Objects for Dreamweaver, Authorware, Authorware

Page 13 - Examples

20ExampleThis example verifies that the user has sent the password “XXXX”. If the password is sent, the user’s access rights are modified and the user

Page 14 - Application.disconnect

Server-Side Communication ActionScript 21Application.onConnectAcceptAvailabilityFlash Communication Server MX (with communication components only)Usag

Page 15 - Application.getStats

22The second example is server-side code you would include in your application’s main.asc file://When using components, always load components.ascload

Page 16 - Application.onAppStart

Server-Side Communication ActionScript 23When you use components, the last line (in order of execution) of the onConnect method should be either appli

Page 17 - Application.onAppStop

24ParametersclientObj A client disconnecting from the application.ReturnsThe server ignores any return value.DescriptionEvent handler; invoked when a

Page 18 - Application.onConnect

Server-Side Communication ActionScript 25Application.registerClassAvailabilityFlash Communication Server MX.Usageapplication.registerClass(className,

Page 19

26ExampleThis example defines a Color constructor function with properties and methods. After the application connects, the registerClass method is ca

Page 20 - See also

Server-Side Communication ActionScript 27proxyConnection A Client or NetConnection object. All requests to execute the remote method specified by meth

Page 21 - Application.onConnectAccept

28DescriptionMethod; rejects the connection call from a client to the server. The application.onConnect event handler notifies a script when a new cli

Page 22 - Application.onConnectReject

Server-Side Communication ActionScript 29ExampleThe following example checks the server property against a string before executing the code inside the

Page 23 - Application.onDisconnect

3CONTENTSServer-Side Communication ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Using server-side ActionScript. . . . . . .

Page 24 - Application.onStatus

30When you call NetConnection.call from a client-side ActionScript script, the method that executes in the server-side script must be a method of the

Page 25 - Application.registerClass

Server-Side Communication ActionScript 31The above example works, but must be executed every time a client connects. If you want the same methods and

Page 26 - Application.registerProxy

32Method summary for the Client object Property summary for the Client object Event handler summary for the Client object Client.agentAvailabilityFlas

Page 27 - Application.rejectConnection

Server-Side Communication ActionScript 33ExampleThe following example checks the agent property against the string "WIN" and executes differ

Page 28 - Application.server

34The following server-side script uses the Client.call method inside the application.onConnect handler to call the random method that was defined on

Page 29 - Client (object)

Server-Side Communication ActionScript 35The sum method can then be called from NetConnection.call on the Flash client side, as shown in the following

Page 30

36ReturnsAn integer indicating bytes per second.DescriptionMethod; returns the maximum bandwidth that the client or the server can use for this connec

Page 31

Server-Side Communication ActionScript 37Client.ipAvailabilityFlash Communication Server MX.UsageClient.ipDescriptionProperty (read-only); contains th

Page 32 - Client.agent

38Client.pingAvailabilityFlash Communication Server MX.UsageClient.pingDescriptionMethod; sends a "ping" message to the client and waits for

Page 33 - Client.call

Server-Side Communication ActionScript 39Clients with read access to a directory that contains streams can play streams in the specified access levels

Page 34

Contents4Client.writeAccess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41load. . . . .

Page 35 - Client.getBandwidthLimit

40ReturnsThe value of the undefined property, which is specified by the propName parameter.DescriptionMethod; provides values for undefined properties

Page 36 - Client.getStats

Server-Side Communication ActionScript 41Client.writeAccessAvailabilityFlash Communication Server MX.UsageClient.writeAccessDescriptionProperty; provi

Page 37 - Client.protocol

42DescriptionMethod (global); loads an ActionScript file inside the main.asc file. This method executes only when the ActionScript file is first loade

Page 38 - Client.readAccess

Server-Side Communication ActionScript 43Method summary for the NetConnection object Property summary for the NetConnection object Event handler summa

Page 39 - Client.__resolve

44Parameters name A string that identifies the header and the ActionScript object data associated with it.mustUnderstand A Boolean value; true indicat

Page 40 - Client.setBandwidthLimit

Server-Side Communication ActionScript 45DescriptionMethod; invokes a command or method on a Flash Communication Server or an application server to wh

Page 41 - Client.writeAccess

46ExampleThe following code closes the NetConnection instance myNetConn:myNetConn.close();NetConnection.connectAvailabilityFlash Communication Server

Page 42 - NetConnection (object)

Server-Side Communication ActionScript 47NetConnection.isConnectedAvailabilityFlash Communication Server MX.UsagemyNetConnection.isConnectedDescriptio

Page 43 - NetConnection.addHeader

48ExampleThis example defines a function for the onStatus handler that outputs messages to indicate whether the NetConnection was successful:nc = new

Page 44 - NetConnection.call

Server-Side Communication ActionScript 49DescriptionMethod (global); continually calls a function or method at a specified time interval until the cle

Page 45 - NetConnection.close

Server-Side Communication ActionScript 5Server-Side Communication ActionScriptServer-Side Communication ActionScript is a scripting language on the se

Page 46 - NetConnection.connect

50Every shared object is identified by a unique name and contains a list of name-value pairs, called properties, just like any other ActionScript obje

Page 47 - NetConnection.onStatus

Server-Side Communication ActionScript 51Method summary for the SharedObject object Property summary for the SharedObject object Event summary for the

Page 48 - NetConnection.uri

52ParametersNone.ReturnsReturns true if successful; false otherwise. DescriptionMethod; deletes all properties and sends a “clear” event to all client

Page 49 - • Sharing data in real time

Server-Side Communication ActionScript 53SharedObject.flushAvailabilityFlash Communication Server MX.UsageSharedObject.flush()ParametersNone.ReturnsA

Page 50

54DescriptionStatic method; returns a reference to a shared object instance. To perform any operation on a shared object, the server-side script must

Page 51 - SharedObject.clear

Server-Side Communication ActionScript 55ExampleThis example creates a shared object named foo inside the function onProcessCmd. The function is passe

Page 52 - SharedObject.close

56SharedObject.getPropertyNamesAvailabilityFlash Communication Server MX.UsagemySharedObject.getPropertyNames()Parameters None.ReturnsAn array contain

Page 53 - SharedObject.get

Server-Side Communication ActionScript 57The this keyword used in the body of the function is set to the shared object instance returned by SharedObje

Page 54

58ExampleThis example outputs foo to the NetConnection Debugger:mySO = SharedObject.get("foo");trace(mySO.name);SharedObject.onStatusAvailab

Page 55 - SharedObject.getProperty

Server-Side Communication ActionScript 59Local shared objectsNote: Changing or deleting a property on the server side using the SharedObject.setProper

Page 56 - SharedObject.handlerName

6To install and test the server-side ActionScript file, do the following: 1 Locate the Macromedia Flash Communication Server /applications directory.T

Page 57 - SharedObject.name

60ExampleThe following example creates a function that is invoked whenever a property of the shared object so changes:// create a new NetConnection ob

Page 58 - SharedObject.onSync

Server-Side Communication ActionScript 61ExampleThis example deletes all properties of the myShared shared object that are older than the value of Sha

Page 59

62ParametersmethodName The name of a method on a client shared object instance. For example, if you specify doSomething, the client must invoke the Sh

Page 60 - SharedObject.purge

Server-Side Communication ActionScript 63DescriptionMethod; updates the value of a property in a shared object. A shared object property can be modifi

Page 61 - SharedObject.send

64ExampleThis example gets the number of properties of a shared object and assigns that number to the variable len: var myShared = SharedObjecd.get(ap

Page 62 - SharedObject.setProperty

Server-Side Communication ActionScript 65Stream (object)The Stream object lets you handle each stream in a Flash Communication Server application. A s

Page 63 - SharedObject.size

66Stream.bufferTimeAvailabilityFlash Communication Server MX.UsageStream.bufferTimeDescriptionProperty (read-only); indicates how long to buffer messa

Page 64 - SharedObject.version

Server-Side Communication ActionScript 67Note: The Stream information object is nearly identical to the client-side ActionScript NetStream information

Page 65 - Stream (object)

68ExampleThis example gets the length of the recorded stream file myVideo and assigns it to the variable streamLen:function onProcessCmd(cmd){var stre

Page 66 - Stream.clear

Server-Side Communication ActionScript 69DescriptionEvent handler; invoked every time the status of a Stream object changes. For example, if you play

Page 67 - Stream.length

Server-Side Communication ActionScript 7Using JavaScript syntaxYou must follow all syntax rules of JavaScript. For example, JavaScript is case-sensiti

Page 68 - Stream.onStatus

70You can also specify a number value of 2 or 3 for the reset parameter, which is useful when playing recorded stream files that contain message data.

Page 69 - Stream.play

Server-Side Communication ActionScript 71If the flag is set to true, some compression is invoked on the server. Using the previous example, if the fla

Page 70

72The following example creates a playlist of three MP3 files (beethoven.mp3, mozart.mp3, and chopin.mp3) and plays each file in turn over the live st

Page 71

Server-Side Communication ActionScript 73ExampleThis example opens a stream s and, when it is open, plays sample and records it. Because no value is p

Page 72 - Stream.record

74The following example is the client-side ActionScript that receives the Stream.send call. The method Test is defined on the Stream object:tStream.Te

Page 73 - Stream.send

Server-Side Communication ActionScript 75traceAvailabilityFlash Communication Server MX.Usagetrace("Hello world");trace("Value of i = &

Page 75 - Availability

77APPENDIXServer-Side Information ObjectsThe Application, NetConnection, and Stream objects provide an onStatus event handler that uses an information

Page 76

Appendix78NetConnection information objectsThe NetConnection object has the same information objects as the client-side NetConnection object. Applicat

Page 77

Server-Side Information Objects 79Stream information objectsThe information objects of the Stream object are similar to those of the client-side NetSt

Page 78 - Appendix78

8getBandwidthLimit Client.getBandwidthLimitgetProperty SharedObject.getPropertygetPropertyNames SharedObject.getPropertyNameshandlerName SharedObject.

Page 80 - Appendix80

Server-Side Communication ActionScript 9Application (object)The Application object contains information about a Flash Communication Server application

Commentaires sur ces manuels

Pas de commentaire