List Info

Thread: Failed with object which is generated dynamically




Failed with object which is generated dynamically
user name
2006-10-29 16:10:12
Hi all 

I have a problem with communication between JS an Flash..
First, I show code below.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transiti
onal.dtd">
<html xmlns="http://www.w3.
org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript"
src="js/swfobject_source.js"></script>
<script type="text/javascript"
src="js/swfobject_js_gateway.js"></script>
;
<script type="text/javascript">
	
	flashProxy = new SWFObject('./flash_modules/Test1.swf',
'Player',320,240, "7,0,0,0", "#ffffff");
	flashProxy.setProxy('Test1',null,
'./flash_modules/JavaScriptFlashGateway.swf'); 

	flashProxy2 = new SWFObject('./flash_modules/Test1.swf',
'Player2',320,240, "7,0,0,0",
"#ffffff");
	flashProxy2.setProxy('Test2',null,
'./flash_modules/JavaScriptFlashGateway.swf'); 

</script>
</head>
<body>

			<input type="button" id="tbutton1"
onclick="test1()" value="test"/>
			<input type="button"
id="btn_toggleaudio1"
onclick="writeFlash()" value="show"/>
			<div id="test1"></div>
<script type="text/javascript">
function test1(){
	flashProxy.call('test');
}

function writeFlash(){
	flashProxy.write(document.getElementById('test1'));

}
</script>

<hr />

			<input type="button" id="tbutton2"
onclick="test2()" value="test"/>
			<div id="test2"></div>
<script type="text/javascript">
function test2(){
	flashProxy2.call('test');
}

flashProxy2.write(document.getElementById('test2'));
</script>
</body>
</html>

The whole code with Flash file is in below.

http://www.yasue.us/JavascriptFlashcommunication.zip
#you must put in doc root in web server, it does'nt work in
FileSystem access.

So the problem is in IE, in firefox it works pretty good,
the second object which is generated in 
loading, that also work, but first object which is generated
when user clicked 'show' button, does not
work.

That's all, I spend three days this this problem, still not
resolved.
Please help me...

Best regards
Ken Yasue


_______________________________________________
Flashjs mailing list
Flashjsosflash.org
http://osflash.org/mailman/listinfo/flashjs_osflash.org
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )