[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

set flash movie embed object  path from javascript var.

Posted on 2013-01-23
2
Medium Priority
?
450 Views
Last Modified: 2013-01-23
In Html page I have javascript variable named as "gameFile" that contain swf path.
How can I set the following embed flash movie code to this javascript Var?
I need to replace the "test.swf" with  "gameFile" var..
I do not have ID for  "gameFile".

<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="640" height="480">
					<param name="movie" value="test.swf">
					<param name="quality" value="High">
					<embed src="test.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="640" height="480"></object>

Open in new window

0
Comment
Question by:yaron89
2 Comments
 
LVL 22

Accepted Solution

by:
Kim Walker earned 2000 total points
ID: 38809571
If I understand your question, you have the statement
var gameFile = "<swf path>";

Open in new window

somewhere in your javascript code (where <swf path> is the actual path). Correct?

Is there only one embed tag in your html page?

If the answers to both questions above are "yes," the following javascript code should accomplish your task.
document.getElementsByTagName("embed")[0].src = gameFile;

Open in new window

0
 

Author Closing Comment

by:yaron89
ID: 38809633
Thank you !
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month18 days, 12 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question