954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Émbed flash in iframe using swfobject

hello,

Please any one send me sample code,...

1)How to embed the flash movie in iframe using swfobject in javascript?


2)How to send parameters from Iframe loaded with flash to that flash movie?


With regards,
Eswaran Saravanan,
University west,
sweden.

eswar.aspire
Newbie Poster
13 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

For 1), just create a php, cf, or asp page and call it swf_page.ext. Next set the CSS body, html, and swf height + width to 100%. Then embed the swf object. When you lauch the page, it should take up the whole screen. next make it where the params get what is passed in the url.

For 2), you will have to pass the parameters using a link. So we will call this main.html. create an iframe (width 300, height 300) and a side nav with a link.

<script type="text/javascript">
function pass_param(param1) {
    document.getElementById("iframe").src = "swf_page.ext?height="+param1;
}
</script>
<a onlick="pass_param('100')">Adjust height to 100</a>


Or if you want to use more than one parameter.

<script type="text/javascript">
function pass_param() {
    var param1 = document.getElementById("input1").value; 
    var param2 = document.getElementById("input2").value;
    document.getElementById("iframe").src = "swf_page.ext?param1="+param1+"&param2="+param2;
}
</script>
<form>
<input type="text" id="input1">
<input type="text" id="input2">
<a onlick="pass_param()">Submit</a>


i hope this helps

fobos
Posting Whiz in Training
297 posts since Feb 2009
Reputation Points: 29
Solved Threads: 52
 

hello fobos,

Thank you very much for your response...

With regards,

Eswaran Saravanan,
University west,
Sweden.

eswar.aspire
Newbie Poster
13 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: