Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 269

Programming actionscript 3.0
Table of Contents

Advertisement

{
myMP3.load(new URLRequest(mp3));
myMP3.play();
}
catch(err:Error)
{
trace(err.message);
// your error handling code here
}
myMP3.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
}
private function linkHandler(linkEvent:TextEvent):void
{
playMP3(linkEvent.text);
// your error handling code here
}
private function errorHandler(errorEvent:IOErrorEvent):void
{
trace(errorEvent.text);
// your error handling code here
}
}
}
Working with status change events
Flash Player dynamically changes the value of the
properties for the classes that support the
netStatus.info.level
classes that have the
status.level
and LocalConnection. You can write a handler function to respond to the change in
value and track communication errors.
The following example uses a
property. If the
level
the message "Video stream failed".
package
{
import flash.display.Sprite;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
level
property are NetConnection, NetStream, and SharedObject. The
property are HTTPStatusEvent, Camera, Microphone,
netStatusHandler()
property indicates that an error has been encountered, the code traces
netStatus.info.level
property. The classes that have the
function to test the value of the
Responding to error events and status
or
status.level
level
level
269

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents