我需要一些关于Flash横幅的帮助。我需要做一个隐藏div的横幅按钮,我已经找到了一种在AS2中做的方法,但是我需要使用AS3,我根本不知道ActionScript,所以我需要你的帮助。Flash按钮隐藏DIV AS3
我发现这个代码,不幸的是它在AS2:
on (release) {
import flash.external.ExternalInterface;
ExternalInterface.call("hideDiv", "operator");
}
<script type="text/javascript">
function hideDiv(id)
{
document.getElementById(id).style.display = 'none';
}
</script>
我的按钮实例名称为“closeBt”,我想隐藏格“#flashcontainer”
请帮助我。
UPDATE
我的AS3代码
import flash.external.ExternalInterface;
import flash.events.MouseEvent;
var myStage:Stage = this.stage;
myStage.scaleMode = StageScaleMode.NO_SCALE;
myStage.align = StageAlign.TOP_LEFT;
function resizeDisplay(event:Event):void{
var swfWidth:int = myStage.stageWidth;
var swfHeight:int = myStage.stageHeight;
var flagaYPos:Number = swfHeight - flaga.height;
var flagaXPos:Number = swfWidth - flaga.width;
flaga.y = 40.75;
flaga.x = -31.4;
}
myStage.addEventListener(Event.RESIZE, resizeDisplay);
closeBt.addEventListener(MouseEvent.CLICK, clickHandler);
trace("Button has been Clicked");
function clickHandler(e:MouseEvent):void {
if(ExternalInterface.available)
ExternalInterface.call("hideDiv", "operator");
}
和我的HTML身体
<body style="margin:0; padding:0">
<script>
function hideDiv("operator")
{
document.getElementById("operator").style.display = 'none';
}
</script>
<div id="operator">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="JavaScript" type="text/javascript">
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
'width', '100%',
'height', '100%',
'src', 'Kopia baner01',
'quality', 'high',
'pluginspage', 'http://www.adobe.com/go/getflashplayer',
'align', 'top',
'play', 'true',
'loop', 'true',
'scale', 'noscale',
'wmode', 'transparent',
'devicefont', 'false',
'id', 'Kopia baner01',
'bgcolor', '#ffffff',
'name', 'Kopia baner01',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'Kopia baner01',
'salign', 't'
); //end AC code
</script>
<noscript>
<object style="display: none" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="100%" height="100%" id="Kopia baner01" align="top">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="Kopia baner01.swf" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="salign" value="t" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /> <embed src="Kopia baner01.swf" quality="high" scale="noscale" salign="t" wmode="transparent" bgcolor="#ffffff" width="100%" height="100%" name="Kopia baner01" align="top" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</noscript>
</div>
</body>
AS是在时间轴上,我没有对AS,AS2或AS3任何技能,我会喜欢将横幅隐藏div如此接近btn会关闭横幅
我发现了一个错误的功能hideDiv(操作员)无法正常工作hideDiv(“经营者”)我不知道我在想什么 – gidzior