Цитата:
|
Нужен, это ничего не меняет.
|
Точно точно?

Код AS3:
package
{
import flash.display.Bitmap;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
import flash.text.TextField;
/**
* ...
* @author
*/
public class Main extends Sprite
{
private var loader:Loader;
private var tf:TextField;
public function Main()
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
loader = new Loader();
tf = new TextField();
tf.x = tf.y = 320;
tf.width = tf.height = 300;
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest("https://dl.dropboxusercontent.com/u/68778662/icon.jpg"));
}
private function onComplete(e:Event):void
{
loader.removeEventListener(Event.COMPLETE, onComplete);
addChild(loader);
addChild(tf);
try {
var bmp:Bitmap = loader.contentLoaderInfo.content as Bitmap;
var str:String = bmp.bitmapData.width + "x" +bmp.bitmapData.height;
tf.text = str;
} catch (e:SecurityError) {
tf.text = "error:" + e.message;
}
}
}
}