-
Animal Flasher
[MX04] Media Playback component & variables...
I'm trying to get a Media Playback component to play videos. I can get it all to work if I hard code the component with this code:
but I'm trying to get it to work by parsing a variable into it using:
Code:
video/+variable+.flv
the variable is parsed into the movie using:
Code:
main.swf?variableID=1234
and the code within the movie to identify the variable:
Code:
var variable = _root.variableID;
but it doesn't work, although I can't see anything wrong with what I've done.
Is it actually possible to use Media Playback component with variables?
Thanks in advance for your help.
Last edited by RobbieC; 09-22-2007 at 01:21 PM.
-
FK'n_dog
variable is a Textfield property, it is recommended to not
use reserved words in your naming strategy in Flash.
i tested with this in html -
<param name="movie" value="test.swf?variableID=1234" />
<embed src="test.swf?variableID=1234" .....
in Flash, i have a dynamic textfield with instance name - varsTxt
and code on the main timeline -
varsTxt.text = "video/"+variableID+".flv";
the textfield shows - video/1234.flv
any help to you ??
-
Animal Flasher
thanks for getting back to me. I don't have a problem getting the variable parsed into the flash movie (using dynamic text like you suggested), but I'm still having problems getting the variable into the MediaPlayback component. If I hard-code :
into the MedaiPlayback component URL, it works, but if I try to use the variable using:
Code:
video/+_root.variableID+.fla
it doesn't.... My question is, on the 'Component Inspector' for the MediaPlayback component, can I put into the URL? It doesn't appear to like it.....
-
FK'n_dog
in folder - video, I have w50s.flv
in html, appended to the object/embed code - "test.swf?variableID=w50s"
in Flash - MediaPlayback component, instance name - myPlybk
and code on main timeline - frame#1 -
path = "video/"+variableID+".flv";
myPlybk.contentPath = path;
hth
-
Animal Flasher
it still doesn't like it.... variableID is successfully parsing, path is being built correctly, but the Media Playback component still won't follow the path....
I've put my working example here http://www.bigbrother.co.uk/videotest.htm and zipped it all up there with a link.
It's probably something stupidly ridiculous that I have missed....
If you can help, I'll be very grateful
Cheers
-
FK'n_dog
haven't dl'd the zip, looking at your html, you need either -
ID.text = variableID;
path.text = "video/"+ID.text+".flv";
myPlybk.contentPath = path.text;
or simply-
path = "video/"+variableID+".flv";
myPlybk.contentPath = path;
-
Animal Flasher
I just don't get it.....
do I have to do anything else to the Media Playback Controller to get it to work? The URL is left blank and all I have done is named it MyPlybk.
the code I have on frame 1 is: MyPlybk.contentPath = path.text;
I have tried every combination of strings and it won't play. It plays fine if I hard code video/1426.flv into the url of the component...... aaarrrghh
-
FK'n_dog
tested online at - http://www.jackleaman.co.uk/test/flv/test.html
zip file - http://www.jackleaman.co.uk/test/flv/test.zip
NOTE: place w50s.flv in video folder
hth
ps..please let me know when you have the zip file
as space is limited on my server
Last edited by a_modified_dog; 09-23-2007 at 07:09 AM.
-
Animal Flasher
I'm so sorry about all this mate. I can't actually open your .fla file.... I'm using MX Pro 2004 and it says it's an 'unexpected file format'.... doh
-
FK'n_dog
-
Animal Flasher
Thank you very much mate - I got it working!
In my Media Playback component, I only had contentPath enabled in 'Schema'
Your version had another 9 properties going on..... I copied those over and it works!!!
Thanks again for your time mate! Much appreciated!
Rob
-
FK'n_dog
you're welcome
-
How do you get rid of the white background in Media playback?
-
media playback
How do you get rid of the white background in Media playback?
-
Originally Posted by RobbieC
Thank you very much mate - I got it working!
In my Media Playback component, I only had contentPath enabled in 'Schema'
Your version had another 9 properties going on..... I copied those over and it works!!!
Thanks again for your time mate! Much appreciated!
Rob
It would be great to know how to do this - use a variable passed via HTML to the SWF and load into mediaPlayback component. The source files you guys were working on have been since removed.
Thank you in advance,
HL
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|