0

我在可能的站点中使用 .swf 文件:

<div>
    <object width="100%" height="100%">
    <embed  src="@Url.Content( "~/Content/TopRight.swf" )"  type="application/x-shockwave-flash" width="310" height="95"></embed>
    </object>
</div>

我想在单击此横幅时打开任何链接(任何页面)。我放入<object>标签<a>,但没有任何改变。我怎样才能做到这一点?

4

1 回答 1

1

将其放在代码的末尾:

import flash.display.MovieClip;

var hit = new MovieClip();
hit.graphics.beginFill(0xFFFFFF);
hit.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
var clicky = new SimpleButton(null,null,null,hit);
this.addChild(clicky);

clicky.addEventListener(MouseEvent.CLICK, function(){
    navigateToURL(new URLRequest("http://google.com"));  
});

应该管用 :)

于 2012-09-14T12:48:28.827 回答