Greg - I'll upload the code sometime today or tonight.

Impudent1 - I'll create a new post sometime today or tonight talking
about what I did.  

I'm starting a new website & blog (www.flexdojo.com). Since it's a
site about FLEX I want to be 100% FLEX based. I'll see if I can 
get more detailed up there over the weekend.

What I've been writing is a video/slide/workbook player. The Video
player is on the left, the slide player is on the right and the 
fill-in-the-blank workbook component under both. The slide player and
workbook are kept in sync with the video using cue points. 

Everything about the slides (content, cue points, properties,
backgrounds, transitions, style names and so much more) are defined in
an XML file. The same goes for the workbook component. It's very
dynamic. It's a great project and I still have much work to do.

My C#, Java, JavaScript background has been a huge help understanding
Flex, which I just started coding in June. I still have tons to learn,
but of all the languages I've worked with in my 20+ years of coding,
Flex 2.0 has become my favorite. I have not been this excited about
programming in a while!

Chris

--- In flexcoders@yahoogroups.com, "Chris Simeone" <[EMAIL PROTECTED]> wrote:
>
> Hi All,
> 
> I've been trying to create a "Buffering" progress bar for streaming
> FLV (via FMS) with the <mx:videoDisplay> component. But, the
> videoDisplay is not firing "progress" events for some odd reason. So I
> changed my strategy and started using the netStream object.
> 
> The video is streaming via FMS, but the netStream "bytesLoaded" and
> "bytesTotal" properties are always zero. Any ideas what I may be doing
> wrong. The code's below. 
> 
> Also, it would be great if anyone can show how to pull this of with
> the <mx:videoDisplay> component as well!!!
> 
> Thanks!
> Chris
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; xmlns="*"
> layout="vertical" horizontalAlign="left"
> creationComplete="onCreationComplete();">
>       <mx:Script>
>               <![CDATA[
>       
>
//////////////////////////////////////////////////////////////////////////
>               import mx.events.VideoEvent;
>               import myComponents.*;
>               import flash.events.*;
>               import flash.net.*;
>               import flash.media.Video;
>               import mx.controls.*;
>               import mx.core.UIComponent;
>       
>
//////////////////////////////////////////////////////////////////////////
>               private var nc:NetConnection;
>               private var stream:NetStream;
>               private var fmsUrl:String;
>               private var flvName:String;
>               private var video:Video;
>               private var loaded_interval:Number;
>       
>
//////////////////////////////////////////////////////////////////////////
>               NetConnection.defaultObjectEncoding = 
> flash.net.ObjectEncoding.AMF0;
>       
>
//////////////////////////////////////////////////////////////////////////
>               public function onCreationComplete():void
>               {
>                       nc = new NetConnection();
>                       configureListeners(nc);
>                       
>                       var videoHolder:UIComponent = new UIComponent();
>                       videoHolder.setActualSize(700, 525);
>                       
>                       video = new Video();
>                       configureListeners(video);
>                       
>                       videoHolder.addChild(video);
>                       video.x = 0;
>                       video.y = 0;
>                       
>                       fmsUrl = "rtmp://localhost/test_video";
>                       flvName = "testVideo";
>                       theBox.addChild(videoHolder);
>                       nc.connect(fmsUrl);
>               }
>               /////////////////////////////////////////////////////////////
>               private function 
> configureListeners(dispatcher:IEventDispatcher):void 
>               {
>                       
> dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
> onSecurityError);
>                       dispatcher.addEventListener(AsyncErrorEvent.ASYNC_ERROR,
onAsyncError);
>                       dispatcher.addEventListener(NetStatusEvent.NET_STATUS, 
> onNetStatus);
>                       dispatcher.addEventListener(ProgressEvent.PROGRESS, 
> onProgress);
>                       dispatcher.addEventListener(Event.ENTER_FRAME, 
> onEnterFrame);
>               }
>               /////////////////////////////////////////////////////////////
>               private function connectStream():void 
>               {
>                       if (stream) 
>                               stream.close();
> 
>                       stream = new NetStream(nc);
>                       configureListeners(stream);
>                       video.attachNetStream(stream);
>                       stream.bufferTime = 10;
>                       stream.play(flvName);
>                       stream.client = this;
>               }
>               /////////////////////////////////////////////////////////////
>               private function onNetStatus(event:NetStatusEvent):void
>               {
>                       trace("onNetStatus: " + event);
>                       switch (event.info.code) 
>                       {
>                                case "NetConnection.Connect.Success":
>                                         
> trace("NetConnection.Connect.Success");
>                                         connectStream();
>                                         break;
>                                case "NetConnection.Connect.Failed":
>                                         trace("NetConnection.Connect.Failed");
>                                         break;
>                                case "NetStream.Buffer.Empty":
>                                         trace("NetStream.Buffer.Empty");
>                                         break;
>                                case "NetStream.Buffer.Full":
>                                         trace("NetStream.Buffer.Full");
>                                         break;
>                                case "NetStream.Play.StreamNotFound":
>                                         trace("stream not found: " + flvName);
>                                         break;
>                       }
>               }               
>               /////////////////////////////////////////////////////////////
>               private function onEnterFrame(event:Event):void
>               {
>                       if(stream == null) return;
>                       var loadpct:Number = stream.bytesLoaded / 
> stream.bytesTotal * 100;
>                       trace("onEnterFrame: " + event + " Loaded: " + loadpct 
> + "%");
>               }
>               /////////////////////////////////////////////////////////////
>               private function onProgress(event:ProgressEvent):void
>               {
>                       trace("onProgress: " + event);
>               }
>               /////////////////////////////////////////////////////////////
>               private function onSecurityError(event:SecurityErrorEvent):void 
>               {
>                       trace("onSecurityError: " + event);
>               }
>               /////////////////////////////////////////////////////////////
>               private function onAsyncError(event:AsyncErrorEvent):void 
>               {
>                       trace("onAsyncError: " + event);
>               }
>               /////////////////////////////////////////////////////////////
>           public function onMetaData(info:Object):void
>           {
>                       trace("metadata: duration=" + info.duration + " width=" 
> +
> info.width + " height=" + info.height + " framerate=" + info.framerate);
>           }
>               /////////////////////////////////////////////////////////////
>               public function onCuePoint(info:Object):void
>               {
>                       trace("cuepoint: time=" + info.time + " name=" + 
> info.name + "
> type=" + info.type);
>               }
>               /////////////////////////////////////////////////////////////
>               public function showMessage(msg:String):void
>               {
>                       trace("showMessage: " + msg + "\n");
>               }       
>               /////////////////////////////////////////////////////////////
>               ]]>
>       </mx:Script>
>       
>       <mx:HBox id="theBox" borderStyle="solid"></mx:HBox>
> </mx:Application>
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to