MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Manuale Utente

Navigare online o scaricare Manuale Utente per Server MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY. Server-Side Communication ActionScript Dictionary Macromedia Manuale Utente

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 80
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 0
Server-Side Communication
ActionScript Dictionary
Macromedia Flash
Communication Server MX 1.5
Vedere la pagina 0
1 2 3 4 5 6 ... 79 80

Sommario

Pagina 1 - ActionScript Dictionary

Server-Side CommunicationActionScript DictionaryMacromedia Flash™ Communication Server MX 1.5

Pagina 2

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

Pagina 3 - CONTENTS

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

Pagina 4 - APPENDIX

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

Pagina 5

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

Pagina 6 - Using naming conventions

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

Pagina 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

Pagina 8

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

Pagina 9 - Application (object)

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

Pagina 10 - Application.acceptConnection

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

Pagina 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

Pagina 12 - Application.clearStreams

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

Pagina 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

Pagina 14 - Application.disconnect

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

Pagina 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

Pagina 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

Pagina 17 - Application.onAppStop

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

Pagina 18 - Application.onConnect

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

Pagina 19

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

Pagina 20 - See also

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

Pagina 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

Pagina 22 - Application.onConnectReject

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

Pagina 23 - Application.onDisconnect

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

Pagina 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

Pagina 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

Pagina 26 - Application.registerProxy

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

Pagina 27 - Application.rejectConnection

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

Pagina 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

Pagina 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

Pagina 30

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

Pagina 31

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

Pagina 32 - Client.agent

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

Pagina 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

Pagina 34

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

Pagina 35 - Client.getBandwidthLimit

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

Pagina 36 - Client.getStats

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

Pagina 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

Pagina 38 - Client.readAccess

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

Pagina 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

Pagina 40 - Client.setBandwidthLimit

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

Pagina 41 - Client.writeAccess

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

Pagina 42 - NetConnection (object)

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

Pagina 43 - NetConnection.addHeader

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

Pagina 44 - NetConnection.call

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

Pagina 45 - NetConnection.close

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

Pagina 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

Pagina 47 - NetConnection.onStatus

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

Pagina 48 - NetConnection.uri

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

Pagina 49 - • Sharing data in real time

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

Pagina 50

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

Pagina 51 - SharedObject.clear

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

Pagina 52 - SharedObject.close

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

Pagina 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

Pagina 54

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

Pagina 55 - SharedObject.getProperty

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 63 - SharedObject.size

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

Pagina 64 - SharedObject.version

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

Pagina 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

Pagina 66 - Stream.clear

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

Pagina 67 - Stream.length

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

Pagina 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.

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 73 - Stream.send

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

Pagina 75 - Availability

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

Pagina 76

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

Pagina 77

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

Pagina 78 - Appendix78

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

Pagina 80 - Appendix80

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

Commenti su questo manuale

Nessun commento