I'm having problems with the FLVPlayback. When I give it a url that
doesn't exist, the state changes to CONNECTION_ERROR. But after that I
don't seem to be able to load a new url into the FLVplayback-component.

 

In draw() all components are created, in update, components are updated.

 

                        private function createVideoComponent():Void{

 
logger.debug("createVideoComponent()");

                                   this._videoPlayer =
FLVPlayback(this.getMovieClip().attachMovie("FLVPlayback",
"my_FLVPlybk", this.movieClip.getNextHighestDepth(), {width:320,
height:240, x:0, y:0}));

                                   this._videoPlayer.skin =
"ClearOverPlaySeekMute.swf";

                                   this._videoPlayer.autoSize = true;

                                   this._videoPlayer.autoPlay = false;

                                   this._videoPlayer.maintainAspectRatio
= true;

                                   this._videoPlayer.idleTimeout = 10;

 
this._videoPlayer.addEventListener("stateChange", Delegate.create(this,
videoPlayer_OnStateChanged));

 
this._videoPlayer.addEventListener("complete", Delegate.create(this,
videoPlayer_OnComplete));

                        }

                        

                        private function
videoPlayer_OnStateChanged(eventObject:Object):Void{

 
logger.info("videoPlayer_OnStateChanged : " + this._videoPlayer.state);

                                   if(this._videoPlayer.state ==
FLVPlayback.CONNECTION_ERROR){

 
this._playButtonComponent._visible = false;

 
this._playButtonLabel._visible = false;

 
this._imageComponent._visible = true;

                                   }else{

                                               logger.info("set
playbutton visible");

 
this._playButtonComponent.getMovieClip()._visible = true;

 
this._playButtonLabel.getMovieClip()._visible = true;

                                   }           

                                   resize();

                        }

                        

                        private function
videoPlayer_OnComplete(evt:Object):Void{

 
logger.debug("videoPlayer_OnComplete()");

                                   this._imageComponent._visible = true;


                        }

 

                        private function
updateVideoComponent(url:String):Void{

                                   logger.debug("updateVideoComponent("
+ url + ")");

                                   this._videoPlayer.stop();

                                   

                                   this._videoPlayer.contentPath =
ShellLocator.getInstance().shell.mapPath(url);

                                   this._videoPlayer.enabled = false;

                                   

                        }

 

                        public function draw():Void{

                                   logger.debug("draw() -- movieClip : "
+ this.movieClip);

                                   createImageComponent();

                                   createVideoComponent();

                                   createTextComponent();

                                   createPlayButtonLabel();

                                   createPlayButtonComponent();

                                   createPlayFullMovieButtonComponent();

                                   createPlayFullMovieGraphicLabel();

                                   createStepsLine();         

                        }

 

                        public function update(o:Observable,
infoObj:Object):Void {

                                    logger.debug("update()");

                                    

 
this._imageComponent.getMovieClip().swapDepths(this.movieClip.getNextHig
hestDepth());

                                    var actions:AttemptActionCollection
= ProcedureAttempt(getAttempt()).getActions();

                                   var action:ProcedureAttemptAction =
actions[0];

                                   var images:Array =
action.step.getAssetsByType(AssetType.IMAGE);

                                   var image:Asset = images[0];

                                   this.updateImageComponent(image);

                                   var videos:Array =
action.step.getAssetsByType(AssetType.VIDEO);

                                   var video:Asset = videos[0];

 
this.updateVideoComponent(video.getValue());

                                   var texts:Array =
action.step.getAssetsByType(AssetType.TEXT);

                                   var text:Asset = texts[0];

                                   this.updateTextArea("<b>" +
action.step.getName() + "</b>" + "<br><br>" + text.getValue());

                                   

                                   //resize();

                        }           

 

 

 

                        

 

lieven cardoen

indiegroup
interactive digital experience
engelse wandeling 2 k18 
b8500 kortrijk 
T +32 (0)56/361 197
// communicatie bij voorkeur op [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 

 

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to