Hi,

I'm trying to play an FLV file within my SWF movie, but I can't seem to get
it to work. More than that,
I can't see the logic behind how this should work. Here's a code I've tried:

01 class com.acme.CustomTab extends AbstractTab {
02
03   private var video:Video *= new Video()*;
04
05   public function init():Void {
06     getURL("javascript:show('hello')");
07     var nc:NetConnection = new NetConnection();
08     nc.connect(null);
09     var ns:NetStream = new NetStream(nc);
10     video.attachVideo(ns);
11     ns.play("http://localhost:8080/videos/sample.flv";);
12     getURL("javascript:show('" + video + "')");
13     video._x = 20;
14     video._y = 20;
15     video._width = 320;
16     video._height = 240;
17   }
18 }

Notes:

   1. It doesn't work.
   2. The SWF runs from a web server running on localhost:8080, so
   there's no local filesystem/network issues.
   I also see an access to the flv file in the server's log.
   3. The javascript:show parts are just to make sure I get to the init
   method.
   4. My main concern is - how's video placed in the object tree? I never
   created it as a child of anything else.
   Some tutorials on the internet assume you places a video object on the
   stage, but I'm using MTASC, I
   need to do this in AS2 code. Has anyone done that?
   5. On line 3 I  tried the definition with and without an
   initialization.
   6. On lines 13-16, I define the video playback size and position. I
   tried doing that eralier and later. I would
   hope I would at least hear the sound, but I hear nothing.
   7. To stage the quite obvious, AbstractTab is a MovieClip (and I call
   the init method manually).
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to