码迷,mamicode.com
首页 > 其他好文 > 详细

[ActionScript 3.0] as3.0加载as2.0的swf时获取as2.0的实际舞台尺寸

时间:2015-10-12 22:20:35      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
var request:URLRequest=new URLRequest("~规格.swf");
loader.load(request);
addChild(loader);


function initHandler(event:Event):void {
    //var loader:Loader=Loader(event.target.loader);
    var info:LoaderInfo=LoaderInfo(loader.contentLoaderInfo);
    trace("initHandler: loaderURL=" + info.loaderURL + " url=" + info.url)
    trace(info.height,info.width);
}
function completeHandler(event:Event):void{
    event.target.content.width=1600
    trace(loader.contentLoaderInfo.width,event.target.content.width)
    //trace("宽",info.width,"高",info.height)
}
function ioErrorHandler(event:IOErrorEvent):void {
    trace("ioErrorHandler: " + event);
}

 

[ActionScript 3.0] as3.0加载as2.0的swf时获取as2.0的实际舞台尺寸

标签:

原文地址:http://www.cnblogs.com/frost-yen/p/4872911.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!