Solved

set flash movie embed object  path from javascript var.

Posted on 2013-01-23
2
440 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 21

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Hidden Field Value 10 34
Jquery autocomplete 10 27
Strip leading 0 from a var 3 13
google marking mail as spam using PHPMailer 6 9
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
The viewer will learn how to count occurrences of each item in an array.

757 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

19 Experts available now in Live!

Get 1:1 Help Now