Код: Выделить всё
package { import flash.display.*; import flash.net.*; import flash.text.*; import flash.events.*; import vk.APIConnection; import vk.events.*; import vk.ui.VKButton; import vk.api.serialization.json.JSON; /** * @author Baltazar */ public class TestApp extends Sprite { private var tf: TextField; private var picLoader:Loader=new Loader(); private var picURL:URLRequest = new URLRequest(); private var loader:URLLoader = new URLLoader(); public function TestApp() { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function fetchUserInfo(data: Object): void { // Example of fetching info from API request for (var key: String in data[0]) { } } private function onApiRequestFail(data: Object): void { // Example of fetching fail from API request trace(data); } private function init(e: Event = null): void { if (e) { removeEventListener(e.type, init); } //******* расположение изображений, подписи к ним и размеров самого изображенияvar text_x=20;var img_x=20;//**********function loadadres(url) :void { //вот она, функция - загрузчик//*******распологаем где надо подпись процента загрузки//***********picURL = new URLRequest(url);//адрес картинки//picLoader = new Loader(); //создаем объект - загрузчикpicLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onLoadProgress);picLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadComplete);//*********добавляем события прогрес загрузки и её завершениеpicLoader.load(picURL);//начинаем загрузку}function onLoadProgress(evt:ProgressEvent):void{//прогресс загрузки }function onLoadComplete(evt:Event):void{//окончание загрузкиvar size = 180;//****изменяем координаты и размер изображенияpicLoader.content.x = img_x;img_x += size + 10;var img_width = picLoader.content.width;var img_height = picLoader.content.height; var new_img_height = img_height * size;var new_img_width = new_img_height / img_width; picLoader.content.width = size;picLoader.content.height = new_img_width;//picLoader.content.height=img_height;picLoader.content.y = 70;//по окончанию выводим картинку на экран(онpreloader on as3а загрузилась в picLoader)addChild(picLoader.content); //показыываем только что загруженное на сцене//*********** addChild(picLoader.content);} var flashVars: Object = stage.loaderInfo.parameters as Object; loadadres("http://cs4351.vkontakte.ru/u29308656/a_fa7eb295.jpg");function btnClick(e:MouseEvent):void { }function onError(event:Event):void { } } }}