with AS2 you have to attach a video object from the library (or have it
already placed on the stage).
What I do is this:
make a movieclip, then put a video object in it and set it to some default
size (320x240 is usually fine).
then give that mc a linkage id, and you can use attachMovie() to place it
when you need it.
If you want to use swfmill, there's a video tag you can use.
On Sun, Apr 6, 2008 at 9:29 AM, Barak Ori <[EMAIL PROTECTED]> wrote:
> 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
>
>
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org