Hi list,


It seems that the MM example to read a progressive video doesn't work :
http://livedocs.macromedia.com/flash/8_fr/main/00002843.html

After some times, It appears that it was a garbage collector issue :

This don't work :

class ProgressiveVideo
{
        public static function main (root:MovieClip)
        {
                root.attachMovie ("video_mc", "video_mc", 1);
                var my_video = root.video_mc.flux;
                var my_nc = new NetConnection ();
                my_nc.connect(null);
                var my_ns = new NetStream(my_nc);
                my_ns.onStatus = function (info)
                {
                        // Never being called !
                        root.video_mc._width = 512;
                        root.video_mc._height = 384;
                };
                my_video.attachVideo(my_ns);
                my_ns.setBufferTime (2);
                my_ns.play("pink.flv");
        }
}

This do work :
class ProgressiveVideo
{
        public static var my_nc:NetConnection;
        public static var my_ns:NetStream;
        public static var my_video:Video;
        public static function main (root:MovieClip)
        {
                root.attachMovie ("video_mc", "video_mc", 1);
                my_video = root.video_mc.flux;
                my_nc = new NetConnection ();
                my_nc.connect(null);
                
                my_ns = new NetStream(my_nc);
                my_ns.onStatus = function (info)
                {
                        root.video_mc._width = 512;
                        root.video_mc._height = 384;
                };
                my_video.attachVideo(my_ns);
                my_ns.setBufferTime (2);
                my_ns.play("pink.flv");
        }
}

The only difference is the use of properties in place of local variables. Seems that the garbage collector dereference all before any stream could begin…

The 3 vars have to be kept, there are needed.

I thought GC was only changed in FP8 not FP7 ?!
And that example doesn't work for both players.

Any one anderstand ?
Here is a pastebin to read it more easily :
http://pastebin.com/669093
-----------
erixtekila
http://blog.v-i-a.net/
_______________________________________________
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