Question : SWF object with FLVPlayback component

Hi Experts, I would like to know how to load videos(mp4) into my FLV component dynamically using swf object. Here is my setup

1. I have a FLVPLayback component on my stage with an instance name of  "myPlayer". It creates an swf called myPlayer.swf

2. I have an html page called embed.html with the following code, which works and shows the swf player. Cool :)

So, how in actionscript do I tell the FLVPlayback component on my stage to look for a var in my html page to load the .mp4?
Any help would be great.
cheers


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
<script type="text/javascript" src="swfobject.js"></script>

<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
   var so = new SWFObject("videoPlayer.swf", "player1", "550", "400", "9", "#336699");
   so.write("flashcontent");
</script>

Answer : SWF object with FLVPlayback component

You could do something like the following:

<code snippet>

Good Luck.

-V
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
//First part is the HTML...

<script type="text/javascript" src="swfobject.js"></script>

<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
    // <![CDATA[
   var so = new SWFObject("videoPlayer.swf", "player1", "550", "400", "9", "#336699");
   so.addVariable("fileName","someVideo.mp4");
   so.write("flashcontent");
   // ]]>
</script>

/*Now the AS code, which can have a different syntax if you're using AS2 or AS3, but it's basically the same gist.

AS2: You can access it the file URL by referencing _root.fileName ('cause that's the name of the variable we're sending)*/

var fileURL:String = _root.fileName;
//something like flvPlayback.load(fileURL); should go here

/*AS3: You can access the same var by referencing root.loaderInfo.parameters.fileName*/
var fileURL:String = root.loaderInfo.parameters.fileName;
//do whatever
Random Solutions  
 
programming4us programming4us