How to play a multiple flash files in html? Its urgent.. [Resolved]

Posted by Shameer.Ali87 under JavaScript on 10/4/2012 | Points: 10 | Views : 2111 | Status : [Member] | Replies : 3
hi all experts,

I have a code to play a flash file in html, here i have used jquery as well as javascript,
here its running fine for 1 flash file, but i want to run multiple flash files 1 after the other depending on the duration..
i want to play multiple files as a loop..

you can have the file from attachment..

here's my code..
here 74700 in milliseconds is the duration for which the flash file reloads..


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>test page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="http://swfobject.googlecode.com/svn-history/r409/trunk/swfobject/swfobject.js"></script>

<script type="text/javascript">
$(document).ready(function(){
startSwf()
})

var restartTime = 74700 //in milliseconds
function stopSwf(){
swfobject.removeSWF("swfLoop");
startSwf();
}

function startSwf() {
$("body").append("<div id='swfLoop'></div>");
swfobject.createSWF({data:"1.swf", width:900, height:400}, null, "swfLoop");
setTimeout('stopSwf()', restartTime);
}
</script>
</head>
<body>
</body>
</html>


any help will be appreciated..
thanks

shameer ali shaik


Responses

Posted by: Shameer.Ali87 on: 10/5/2012 [Member] Starter | Points: 25

Up
0
Down

Resolved
I got the code my self..
here's my code..

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>test page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="swfobject.js"></script>


<script type="text/javascript">
var i=1;
var restartTime = 20700; //in milliseconds
function stopSwf()
{
i=i+1;
swfobject.removeSWF("swfLoop");
startSwf();
}

function startSwf()
{
if(i==4)
{
i=1;
}
$("body").append("<div id='swfLoop'></div>");
var flash = i+".swf";
swfobject.createSWF({data:flash, width:900, height:400}, null, "swfLoop");
setTimeout('stopSwf()', restartTime);
}
</script>
</head>
<body onload="startSwf()">
</body>
</html>


here u have put the support files for the above code to work properly..

and this code works fine in firefox, chrome, opera and this will not work in IE...

thanks




shameer ali shaik

Shameer.Ali87, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shameer.Ali87 on: 10/4/2012 [Member] Starter | Points: 25

Up
0
Down
hi all,

I have a c# code which exactly fits for the above scenario, i want to implement this scenario in the above to play multiple flash files in html...

here's my code...

here A,B,C are similar to my flash files..

static void Main(string[] args)

{
string[] strArray = { "A","B","C" };
//int[] intArray = new int[6];

for (int a = 2; a >= 0; a--)
{
foreach (string str in strArray)
{
Console.WriteLine(str);
}
}
Console.ReadLine();
}



any one can help me please...
thanks

shameer ali shaik

Shameer.Ali87, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shameer.Ali87 on: 10/10/2012 [Member] Starter | Points: 25

Up
0
Down
hi all,
any one know how to play the above flash file in IE..
any help will be appreciated..

thanks



shameer ali shaik

Shameer.Ali87, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response