views:

151

answers:

3

Hey everyone,

It is very difficult to find good resources for Haxe information so I am hoping someone out there can help me. I have an FLV movie in the same directory as the SWF I am generating. I cannot get the FLV to play. I can get this working in AS but I need to know what I am doing wrong in my Haxe code.

Hope someone can help.

Thanks.

var mc:MovieClip = Lib._root;



 var connection:NetConnection = new NetConnection();
 connection.connect(null);
 var stream:NetStream = new NetStream(connection);

 mc.attachVideo(stream);
 trace(mc.flash.Video);
 stream.play("default.flv");
A: 

There's nothing inherently different from haXe and AS when it comes to play video as you would be using AS libraries. To which player are you compiling to? Because if you are compiling to playaer >= 9 you are missing a few bits.

You can check out my example of AS3 player here (scroll down to createVideo()) to find out exactly what (create the Video object, attach to the display list, etc).

I'm also guessing that you are not getting any compiler errors, right?

Juan

Zárate
A: 

What player version do you target? For 10 the stage is flash.Lib.current. Do haxe compiler says something about errors?

stroncium
+1  A: 

Here is a Google Code project that demos a nice flash media server. It plays and even records videos. http://code.google.com/p/haxevideo/

RyanTM