views:

42

answers:

2

Hello

I have embed tag and its configured as:

<embed flashparam="config={"playitem":[{"url":"http://localhost/test.flv","autoPlay":false}]}" 

Now i want change the "URL" dynmically. How can i change it using jquery?

THX

+2  A: 

you can change it by doing:

$('embed').attr('flashparam', 'config={"playitem":[{"url":"http://localhost/test.flv","autoPlay":false}]}');

But as @Pekka mentioned, the change will not make it to the flash movie so there is no point to do this. Read the below article which talk about how to pass variable values between flash and your page (Read "Using JavaScript" section):

http://kb2.adobe.com/cps/142/tn_14253.html

Here is a working version:

http://www.permadi.com/tutorial/flashjscommand/

I hope this help!

Mouhannad
Well i need to just change the URL and not the entire attribute. Is there any way out there?Please do not worry about the Flash, it will play the flv file once i replace the new one. I just need to replace the URL paramater with the new FLV file
hmm i'm not sure if i could believe that. if you use chrome or firefox firebug, you can inspect your html and change your attr on the fly (equivalent when jquery changes the attr but this will be easier to test). please do this and test if what you are saying will definitely work.
Mouhannad
Hello Mr. Mouhannad,Thanx for your kind advice on How to use firebug on firefox for debuging purpose.I would like to share with you Mr. Mouhannad that before posting the question, i had already tested it on firefox with the help of firebug(as you mentioned) and its working for me.That is the only the reason i posted this question over here. Also, i have specifically asked that whether "URL" can be be changed or not? Isn't it?The question is not whether it will work or not? Your statetments are under estimating the power of jQuery. I guess your unware with the richness of jQuery?
lol. first of all calm down, why are you taking this personal?? no one here knows what level of programming you are capable of. i was only trying to suggest steps that could help the process - we are only trying to help, remember? for the future, maybe mention in your questions what steps you have done if you will get offended like this. thanx and goodby!!
Mouhannad
Well again thanx for your help in answering
Oh Well again thanx for your help in answering the question at your level of programming. Keep it up Boy. Surely got the level from your answer.Personal me ?? think of it
+1 to Mouhannad for a good answer and good advice.
Lars
A: 

Hi,

This should work out fine

var e = $('#container').text();
e.replace(/\./g, "[this is period]");
Jean