Показать сообщение отдельно
Старый 16.06.2010, 18:33
greegreeman вне форума Посмотреть профиль Отправить личное сообщение для greegreeman Найти все сообщения от greegreeman
  № 9  
Ответить с цитированием
greegreeman
 
Аватар для greegreeman

Регистрация: Jan 2010
Сообщений: 147
показываю весь html:

Код:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


		<script language="JavaScript">
			     		
			function test() {
				//alert("hello");
        		//thisMovie("myFlashContent").test();
				document.getElementById("myFlashContent").test();					
     			}
 		</script>


		<script type="text/javascript" src="swfobject.js">
			swfobject.registerObject("myFlashContent", "9.0.0");									
							
		</script>
        
	</head>
	<body>
		<div>
			<object classid="тут был classid" width="500" height="400" id="myFlashContent" name="TestExternalInterface">
				<param name="movie" value="TestExternalInterface.swf" />
				<param name="allowfullscreen" value="true" />
                <param name="allowScriptAccess" value="always" />
				<param name="flashvars"/>
				<!--[if !IE]>-->
				<object type="application/x-shockwave-flash" data="TestExternalInterface.swf" width="500" height="400">
					<param name="allowfullscreen" value="true" />
                    <param name="allowScriptAccess" value="always" />
					<param name="flashvars"/>
				<!--<![endif]-->
					<a href="http://www.adobe.com/go/getflashplayer">
						<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
					</a>
				<!--[if !IE]>-->
				</object>
				<!--<![endif]-->
			</object>
		</div>		

		<input type="button" onclick="test()" value="Test" />		
				

	</body>
</html>
на стороне флэш:
Код AS3:
 
private function init():void
{
	trace("ExternalInterface.available " + ExternalInterface.available)
	if (ExternalInterface.available) {
		try {
			ExternalInterface.addCallback("test", needToCall);
		} catch (error:SecurityError) {
		trace("A SecurityError occurred: " + error.message + "\n");
		} catch (error:Error) {
			trace("An Error occurred: " + error.message + "\n");
		}
			} else {
				trace("External interface is not available for this container.");
			}
 
	//ExternalInterface.addCallback("test", flashFunc);
	trace("I am here");
}
 
private function needToCall():void
{
      trace("!!!!!!!!!!!!!!!!!!!!!!!!!!");
}