dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Using Cue points with NetStream

  1. #1
    Senior Member
    Join Date
    May 2008
    Posts
    332

    Using Cue points with NetStream

    I have a video with 2 embedded cue points (event). The video player uses NetStream and is NOT a FLV Playback component. I can trace them and see both name and time with this:
    Code:
    ns.onCuePoint = function(evt:Object):Void {
    	banner_holder.loadMovie("banner_anime.swf");
    	trace(evt.name);
    	trace(evt.time);
    }
    That action will also do the loadMovie, so I know the loadMovie part works. But since there are 2 cue points the loadMovie fires with each cue point... not what I had in mind.
    I just don't know how to get the loadMovie to fire outside of that function. I've tried this:
    Code:
    var listenerObject:Object = new Object();
    listenerObject.cuePoint = function(eventObject:Object):Void {
    
    	if(eventObject.info.name == "play_vid1"){
    		banner_holder.loadMovie("banner_anime.swf");
    	} 
    
    	else if (eventObject.info.name == "play_vid2"){
    	holder.loadMovie("intro.swf");
    	}
    };
    video_screen.addEventListener("cuePoint",listenerObject);
    But that must be for the FLVPlayback component and not NetStream because it does nothing.
    Any help would be much appreciated!
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com

  2. #2
    Senior Member
    Join Date
    May 2008
    Posts
    332
    For anyone interested in using cue points with NetStream, read the post above and add:
    Code:
    ns.onCuePoint = function(evt:Object){
        trace(evt.name);
        trace(evt.time);
        if(evt.name == "play_vid1") { 
            trace("YO!Loading banner_holder!");
            banner_holder.loadMovie("banner_anime.swf");
        }
    
        if(evt.name == "play_vid2") { 
            holder.loadMovie("intro.swf");
        }
    };
    Problem resolved!
    Best wishes,
    EfV

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