Solved

set flash movie embed object  path from javascript var.

Posted on 2013-01-23
2
442 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 500 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

815 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now