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.

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

hello fobos,

Thank you very much for your response...

With regards,

Eswaran Saravanan,
University west,
Sweden.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.