![]() |
|
||||||||||
|
|||||
|
Регистрация: Sep 2007
Сообщений: 36
|
public class myImage extends Image
{
public function myImage()
{
super();
trace(loaderInfo);
loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
}
private function onProgress(e:ProgressEvent):void {
trace("Загружено " + this.loaderInfo.bytesLoaded + " из " + this.loaderInfo.bytesTotal);
}
}
|
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
А документация по свойству loaderInfo что нам говорит?
|
|
|||||
|
Регистрация: Sep 2007
Сообщений: 36
|
The loaderInfo property is defined only for the root display object of a SWF file or for a loaded Bitmap (not for a Bitmap that is drawn with ActionScript)
Тогда пробуем по другому <?xml version="1.0" encoding="utf-8"?>
<mx:Image xmlns:mx="http://www.adobe.com/2006/mxml" activate="init()">
<mx:Script>
<![CDATA[
import mx.controls.Text;
private function init():void {
trace("Image Init");
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
}
private function onProgress(e:ProgressEvent):void {
trace("Загружено " + this.loaderInfo.bytesLoaded + " из " + this.loaderInfo.bytesTotal);
}
]]>
</mx:Script>
</mx:Image>
|
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Разве Image шлет прогресс через loaderInfo? (лень смотреть доку, посмотрите вы за меня).
|
|
|||||
|
Регистрация: Jul 2008
Сообщений: 43
|
geron3, а тебе надо знать сколько конкретно загружено или вообще когда загрузится изображение?
|
|
|||||
|
Регистрация: Sep 2007
Сообщений: 36
|
Я уже нашел решение, нужно отслеживать событие progress и complete самого image. А данные брать image.bytesLoaded image.bytesTotal.
Т.е. не использовать loaderInfo |
![]() |
![]() |
Часовой пояс GMT +4, время: 17:45. |
|
|
« Предыдущая тема | Следующая тема » |
|
|