  | | | Why is NetStream.Play.Stop not firing? | Why is NetStream.Play.Stop not firing? 2004-03-12 - By Michael Griffith
Back Coders:
I am having trouble with my NetStream object and hope that you can help. Specifically, the NetStream.Play.Stop event is not firing.
The NetStream object is made in the standard way (code to follow) and is playing my FLV beautifully. NetStream.Play.Start fires as expected, as does NetStream.Buffer.Full.
When the FLV has finished playing - nothing. Shouldn't NetStream.Play.Stop fire?!?!
Has anyone else seen this behavior from NetStream.onStatus? I want to use the NetStream.Play.Stop to dissolve off the video window so I don't have a black box sitting on screen.
All thoughts are appreciated.
Background: the Embedded Video object is sitting in a MC called video_mc. It is the video_mc's alpha that I will reduce to 0 using an onEnterFrame function to perform the dissolve off effect. Note that there isn't a netStream.play() in the following code snippet because it is being handled at a different level of the program. The program is basically a video jukebox that plays different FLVs in the same NS obj. The paths to the FLVs are stored in an XML document (which is why the play is in a different part of the program).
// Create a NetConnection object: var netConn:NetConnection = new NetConnection(); // Create a local streaming connection: netConn.connect(null); // Create a NetStream object and define an onStatus() function: var netStream:NetStream = new NetStream(netConn); // Attach the NetStream video feed to the Video object: video_mc.my_video.attachVideo(netStream); video_mc._alpha = 0; // Set up the volume movieClip this.createEmptyMovieClip("sound_mc",99); sound_mc.attachAudio(netStream); var soundControl = new Sound(sound_mc); soundControl.setVolume(100); // Set the buffer time: netStream.setBufferTime(7); netStream.onStatus = function(info) { var log_stream:String; log_stream += "\n-- ---- ---- ---- ---- ---- ---- -----\n"; log_stream += "NetStream Event: " + info.code + "\n"; log_stream += "Type: " + info.level + "\n"; log_stream += "-- ---- ---- ---- ---- ---- ---- -----\n"; trace(log_stream); if (info.code == "NetStream.Play.Stop") { _root.dissolveOff(_root.video_mc); } }
================================================ Michael Griffith Application Systems Analyst mgriffit@(protected) Family & Community Medicine 520-626-1018 University of Arizona ================================================
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Supported by Fig Leaf Software =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Be sure to check the archives and the wiki: http://chattyfig.figleaf.com/ =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106790 =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe send a blank e-mail to: Normal Mode: flashcoders-unsubscribe@(protected) Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|
 |