playing a flv

View: New views
2 Messages — Rating Filter:   Alert me  

playing a flv

by 010 010 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hiya.

I'm very new to the world of actionscipt and find most tutorials that
assume a flash-ide to be very unhelpful.  Any direction towards
tutorials or sample code that address an swfmill/MTASC setup would be
appreciated.

Specifically, I found some code in the archives from a while ago <a
href="http://lists.motion-twin.com/pipermail/mtasc/2005-November/028630.html">(2005)</a>
that is supposed to play a .flv file.

cutting and pasting this code into Application.as and app.xml, then
compiling with thic code:

> mtasc -swf build/classes.swf -header 1:1:24 Application.as
> swfmill simple app.xml build/app.swf


I get the error that type error unknown variable Debugger.  The code
doesn't seem irrational to me, but i dont understand it enough to
modify it.  I embeded app.swf in an html anyways and got a blank
screen.  I expect this code to just play the .flv (i converted an mpeg
to flv with ffmpeg) when i view the html.

any help with this or re-direction to some other tutorial (one closer
to my level) would be beneficial to me, for sure.

thanks

below is the code I used:

Application.as
-----------------------------

dynamic class Application extends MovieClip
{
       
        public static var timer:Number;
       
        private var video:Video;
        private var nc:NetConnection;
        private var ns:NetStream;
       
        function Application(target)
        {
               
                target.__proto__ = this.__proto__;
                target.__constructor__ = Application;
               
                this = target;
                // Attach the library symbol embedded by swfmill
                this.attachMovie("VideoDisplay", "VideoDisplay", 15);
                // Create a NetConnection object
                nc = new NetConnection();
                // Create a local streaming connection
                nc.connect(null);
                ns = new NetStream(nc);
                // Attach the NetStream video feed to the Video object
                this["VideoDisplay"]["vid"].attachVideo(ns);
                // Begin playing the FLV file
                ns.play("/home/elbiot/flash/Project1/kimme3.flv");
               
        }
       
        static function main()
        {
                Debugger.startDebugger();
                // Algo de tiempo para el pobre debugger.
                Application.timer = setInterval( function ()
                        {
                  clearInterval(Application.timer);
                                Application.comenzar();
                        }
                      , 2000);
        }
       
        static function comenzar()
        {
                var App:Application = new Application(_root);
        }
}


app.xml
----------------------------------

>  <?xml version="1.0" encoding="UTF-8"?>
>  <movie width="800" height="600" framerate="25" version="8">
>    <background color="#FFFFFF" />
> <frame>
> <library>
> <clip id="VideoDisplay">
> <frame>
> <video id="vid" width="240" height="180" smoothing="3" />
> <place id="vid" name="vid" />
> </frame>
> </clip>
> </library>
> </frame>
> </movie>

--
MTASC : no more coffee break while compiling

RE: playing a flv

by PiR Durand :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

the debbuger class points towards an external debugger, such as
flashinspector, etc...
for your tests, you can either install one of them or comment the Debugger
related lines

++
PiR


-----Message d'origine-----
De : mtasc-bounces@...
[mailto:mtasc-bounces@...] De la part de bob ockel
Envoyé : mercredi 20 juin 2007 10:17
À : mtasc@...
Objet : [mtasc] playing a flv

hiya.

I'm very new to the world of actionscipt and find most tutorials that
assume a flash-ide to be very unhelpful.  Any direction towards
tutorials or sample code that address an swfmill/MTASC setup would be
appreciated.

Specifically, I found some code in the archives from a while ago <a
href="http://lists.motion-twin.com/pipermail/mtasc/2005-November/028630.html
">(2005)</a>
that is supposed to play a .flv file.

cutting and pasting this code into Application.as and app.xml, then
compiling with thic code:

> mtasc -swf build/classes.swf -header 1:1:24 Application.as
> swfmill simple app.xml build/app.swf


I get the error that type error unknown variable Debugger.  The code
doesn't seem irrational to me, but i dont understand it enough to
modify it.  I embeded app.swf in an html anyways and got a blank
screen.  I expect this code to just play the .flv (i converted an mpeg
to flv with ffmpeg) when i view the html.

any help with this or re-direction to some other tutorial (one closer
to my level) would be beneficial to me, for sure.

thanks

below is the code I used:

Application.as
-----------------------------

dynamic class Application extends MovieClip
{
       
        public static var timer:Number;
       
        private var video:Video;
        private var nc:NetConnection;
        private var ns:NetStream;
       
        function Application(target)
        {
               
                target.__proto__ = this.__proto__;
                target.__constructor__ = Application;
               
                this = target;
                // Attach the library symbol embedded by swfmill
                this.attachMovie("VideoDisplay", "VideoDisplay", 15);
                // Create a NetConnection object
                nc = new NetConnection();
                // Create a local streaming connection
                nc.connect(null);
                ns = new NetStream(nc);
                // Attach the NetStream video feed to the Video object
                this["VideoDisplay"]["vid"].attachVideo(ns);
                // Begin playing the FLV file
                ns.play("/home/elbiot/flash/Project1/kimme3.flv");
               
        }
       
        static function main()
        {
                Debugger.startDebugger();
                // Algo de tiempo para el pobre debugger.
                Application.timer = setInterval( function ()
                        {
                  clearInterval(Application.timer);
                                Application.comenzar();
                        }
                      , 2000);
        }
       
        static function comenzar()
        {
                var App:Application = new Application(_root);
        }
}


app.xml
----------------------------------

>  <?xml version="1.0" encoding="UTF-8"?>
>  <movie width="800" height="600" framerate="25" version="8">
>    <background color="#FFFFFF" />
> <frame>
> <library>
> <clip id="VideoDisplay">
> <frame>
> <video id="vid" width="240"
height="180" smoothing="3" />
> <place id="vid" name="vid" />
> </frame>
> </clip>
> </library>
> </frame>
> </movie>

--
MTASC : no more coffee break while compiling



--
MTASC : no more coffee break while compiling