Overview
I’m working with FMS 3, and extending the vod player. the end result is to be able to load a movie through the use of a flashvar, so i can use one copy of the swf file and simply send which movies i want to be played through to the player.
The AS where i’m attempting to feed in the information is as follows:
var movieUrl:String = root.loaderInfo.parameters["filename"];
And i’m passing the flashvars using swfobject.
<script type="text/javascript">
var flashvars = {};
flashvars.filename = "rtmp://172.16.10.213/vod/Statlock.flv";
var params = {};
var attributes = {};
swfobject.embedSWF("vodtest.swf", "flashDiv", "660", "700", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
</script>
Well, the video never seems to load. my AS file works properly if i assign the value of the movie to the movie variable.
var movieUrl:String = "rtmp://172.16.10.213/vod/Statlock.flv";
is there a certain way i should be exporting the movie?
I have 2 files, vodtest.fla & vodtest.as.
When i test the movie from flash, it doesn’t load where it’s not accepting a parameter.
I open the same movie in a web browser and it still does not load, whereas it should be accepting the runtime parameter. Should i be doing something different?
in as3 you can have a document class which goes in an external file instead of the timeline. remove any code from the timeline and put it in a file called “Test.as”. if you open publish settings and click the actionscript button you should see the option to set a document class for the file; enter “Test” and make sure that the .as file you saved before is in the same directory as your .fla
Here’s what i got.
Complier Errors - 1 reported
Location test.as, Line 1: 5008: The name of definition ‘Test’ does not reflect the location of this file. Please change the definition’s name inside this file, or rename the file. C:\Documents and Settings\moorert\My Documents\Flash\LMS Video Player\swfobject\ est\ est.as
I have test.fla & test.as in the same folder, C:\Documents and Settings\moorert\My Documents\Flash\LMS Video Player\swfobject\ est\ est.as.
The Document class in test.fla points to test.as in the document class in the properties window.
When i published the movie, and opened my webpage the swf file still didn’t accept my flashvars.
cool. so yours seems to work, but i’m still not getting any love from flash on mine. I’ve attached my files (it’s 1.3 MB in size so sp wouldn’t allow me to upload it). You can see in vodtest.as line 11 where i’m attempting to call the video from the flashvars.
var movieUrl:String = LoaderInfo(this.root.loaderInfo).parameters["filename"];
Again, if i use a direct link to a flv such as
var movieUrl:String = "rtmp://172.16.10.213/vod/Statlock.flv";
the movie will play fine. Maybe you can see something i’m missing here for the loaderinfo not to work.