MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Spezifikationen Seite 158

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 369
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 157
Chapter 480
NetStream.time
Although it is not explicitly stated in the Client-Side Communication ActionScript Dictionary, the
NetStream.time property returns a value that is internally accurate to a few hundredths of a
second, and not just whole seconds. Therefore, you can use this command to return values at a
more granular level. For example, you can multiply the value returned by
NetStream.time
by 1000 to determine the time to the nearest millisecond.
NetStream.bufferTime
For playback streams, the value returned by
NetStream.bufferTime specifies how much of the
stream Flash Communication Server will buffer before the Flash Player starts playing it back. For
example, if your recorded stream is 50 seconds long and your playback speed is twice as fast as
your download speed, you might consider setting this value to 25 seconds. You will thus be able
to play all of the stream without any stalls.
For publishing streams, this value specifies how long the outgoing queue can grow before the
Flash Player considers dropping messages; to determine how much data is currently in the queue,
use
NetStream.bufferLength. For a fast connection, the value returned by
NetStream.bufferLength will never approach the value of NetStream.bufferTime, but on a
slow connection it might.
Therefore, if you know your application is running over a slow connection and you want to
minimize dropped messages or stalled playback, you might want to use
NetStream.setBufferTime to increase the value of NetStream.bufferTime.
SharedObject object
Shared objects can be used for a wide number of purposes, and can be designed and used in a
number of ways. This section provides some items to consider as you begin using shared objects
in your applications.
SharedObject.onSync
Before attempting to work with a remote shared object, you should first check that
SharedObject.connect returned true, indicating a successful connection, and then wait until
you receive a result from the function you have assigned to SharedObject.onSync. If you fail to
do so, any changes you make to the object locally—before
SharedObject.onSync is invoked—
may be lost.
The
SharedObject.onSync handler is invoked when any of the SharedObject.data properties
of the remote shared object are changed, and also the first time a client uses the
SharedObject.getRemote command to connect to a remote shared object that is persistent
locally and/or on the server. In the latter case, all the properties of the object are set to empty
strings, and
SharedObject.onSync in invoked with the value of code set to "clear". Then
SharedObject.onSync is invoked again, this time with the value of code set to "change",
and the properties of the client’s instance of the remote shared object will be set to match those
on the server.
Seitenansicht 157
1 2 ... 153 154 155 156 157 158 159 160 161 162 163 ... 368 369

Kommentare zu diesen Handbüchern

Keine Kommentare