dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: VideoState event

  1. #1
    Senior Member
    Join Date
    Nov 2004
    Location
    Amsterdam
    Posts
    212

    VideoState event

    hi,

    I'm wondering how to use VideoState events with the LFLVPlayback.state property, because the following code doesn't trace anything in the listener function:
    Code:
    import fl.video.*;
    
    myVid.addEventListener(VideoState.LOADING, videoComponentListener);
    myVid.addEventListener(VideoState.PLAYING, videoComponentListener);
    myVid.addEventListener(VideoState.BUFFERING, videoComponentListener);
    
    function videoComponentListener(e:VideoState):void{
    	
    	trace(myVid.state);
    	
    }

    thanks!

    Jeff.

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    This is how you can use it:
    flvPlayback.addEventListener(VideoEvent.PLAYING_ST ATE_ENTERED, lHandler);
    private function lHandler(event:VideoEvent):void
    {
    if(flvPlayback.state==VideoState.PLAYING)
    {
    trace("playing");
    }
    }
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Senior Member
    Join Date
    Nov 2004
    Location
    Amsterdam
    Posts
    212
    thanks! Works great now :-).

  4. #4
    Registered User
    Join Date
    Sep 2011
    Posts
    1
    Hi jerryjj, I was searching for the solution of the same problem, I read the cancerinfor answer then I found a new (and I think better) solution. Many years have passed your question but I wanted to post the solution. This is the code:

    myVideo.addEventListener(VideoEvent.STATE_CHANGE, traceState);

    function traceState(e:VideoEvent):void{
    trace(myVideo.state);
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center