System.onStatus
663
System.onStatus
Availability
Flash Player 6.
Description
Event handler: provides a “super” event handler for certain objects.
The LocalConnection, NetStream, and SharedObject objects provide an
onStatus
event handler
that uses an information object for providing information, status, or error messages. To respond
to this event handler, you must create a function to process the information object, and you must
know the format and contents of the information object returned.
In addition to the specific
onStatus
methods provided for the objects listed above, Flash also
provides a “super” function called
System.onStatus
. If
onStatus
is invoked for a particular
object with a
level
property of
"error"
and there is no function assigned to respond to it, Flash
processes a function assigned to
System.onStatus
if it exists.
Note:
The Camera and Microphone classes also have
onStatus
handlers, but do not pass information
objects with a level property of "error". Therefore,
System.onStatus
is not called if you don’t specify a
function for these handlers.
The following example illustrates how you can create generic and specific functions to process
information objects sent by the
onStatus
method.
// Create generic function
System.onStatus = function(genericError)
{
// Your script would do something more meaningful here
trace("An error has occurred. Please try again.");
}
// Create function for NetStream object
// If the NetStream object returns a different information object
// from the one listed below, with a level property of "error",
// System.onStatus will be invoked
videoStream_ns.onStatus = function(infoObject) {
if (infoObject.code == "NetStream.Play.StreamNotFound") {
trace("Could not find video file.");
}
}
See also
Camera.onStatus
,
LocalConnection.onStatus
,
Microphone.onStatus
,
NetStream.onStatus
,
SharedObject.onStatus
Содержание FLASH MX 2004 - ACTIONSCRIPT
Страница 1: ...ActionScript Reference Guide...
Страница 8: ...8 Contents...
Страница 12: ......
Страница 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Страница 54: ...54 Chapter 2 ActionScript Basics...
Страница 80: ...80 Chapter 3 Writing and Debugging Scripts...
Страница 82: ......
Страница 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Страница 112: ......
Страница 120: ...120 Chapter 6 Using the Built In Classes...
Страница 176: ......
Страница 192: ...192 Chapter 10 Working with External Data...
Страница 202: ...202 Chapter 11 Working with External Media...
Страница 204: ......
Страница 782: ...782 Chapter 12 ActionScript Dictionary...
Страница 793: ...Other keys 793 221 222 Key Key code...
Страница 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Страница 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Страница 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Страница 816: ...816 Index...