Graphics Flex


        xmlns:mx="http://www.adobe.com/2006/mxml"
        initialize="init();">
    
        
            import mx.controls.VideoDisplay;
            import mx.controls.Alert;
            import mx.events.VideoEvent;
            private var videoDisplay:VideoDisplay;
            private function init():void {
                videoDisplay = new VideoDisplay();
                videoDisplay.addEventListener(VideoEvent.STATE_CHANGE,onError);
                videoDisplay.source = "http://server.com/a.flv";
                addChild(videoDisplay);
            }
            private function onError(evt:VideoEvent):void {
                switch (evt.state) {
                    case VideoEvent.CONNECTION_ERROR:
                        evt.currentTarget.visible = false;
                        Alert.show(evt.currentTarget.source, "Failed to connect to video");
                        break;
                }
            }