"ProgressEvent.PROGRESS" start at 80% with firefox and safari

1 view
Skip to first unread message

weberm...@hotmail.com

unread,
Jan 7, 2009, 1:56:03 PM1/7/09
to masapi
Hi and thanks for having developped MASAPI class.

I have a problem with safari and firefox, works perfectly with
Internet explorer 6 et 7.

When i want to download all my files in the same time the
Progress.Event start at 80% with firefox. I have to set
loader.massLoader.parallelFiles = 1 to fix the problem to download
files one by one. Like that progress.Event start at the begenning with
firefox and safari too.
I use specific loader swf file witch is 20ko.

Would you know what is the problem? thanks and sorry for my english.
This a part of interesting code.



var loader:CompositeMassLoader = new CompositeMassLoader();
loader.massLoader.parallelFiles = 1;<== i have to download one by one
to fix the problem

//ajout du main swf
fichier_swf = loader.addFile(main_swf);
loader_swf = fichier_swf.getData();

//variable recvant les url des imges succesives
var fichier_img:String;

for(var i:String in xml..projet) {
fichier_img = xml.projet[i].image.@chemin;
this["fichier"+i] = loader.addFile(fichier_img);
this["fichier"+i].virtualBytesTotal = 50000;//50ko
}

loader.massLoader.addEventListener(ProgressEvent.PROGRESS,
loadProgress);
loader.massLoader.addEventListener(Event.COMPLETE, loadComplete);
loader.start();
}

function loadProgress(evt:ProgressEvent):void {
var scale = evt.target.bytesLoaded/evt.target.bytesTotal;
preload.barre_generale.barre.scaleX = scale;
}

Cédric Tabin

unread,
Jan 7, 2009, 5:11:26 PM1/7/09
to mas...@googlegroups.com, weberm...@hotmail.com
Hello,

If you don't specify the parallelFiles property (revision 95 - masapi 1.5), masapi will try to open all the files before dispatching the first ProgressEvent event. So you have two solutions :

- set the MassLoader.alwaysDispatchProgressEvent to 'true'
- use the last version of masapi (revision 130 - masapi 2.0) that you can download here

Let me know if you have any other problem !

Regards,
Cedric

weberm...@hotmail.com

unread,
Jan 8, 2009, 7:39:53 AM1/8/09
to masapi
Hello,
Your two solutions work perfectly. I choose to do the update.
Thanks a lot and congratulation for this very usefull AS3 class.

see you
Romain.




On 7 jan, 23:11, "Cédric Tabin" <tabin.ced...@gmail.com> wrote:
> Hello,
>
> If you don't specify the parallelFiles property (revision 95 - masapi 1.5),
> masapi will try to open all the files before dispatching the first
> ProgressEvent event. So you have two solutions :
>
> - set the MassLoader.alwaysDispatchProgressEvent to 'true'
> - use the last version of masapi (revision 130 - masapi 2.0) that you can
> download here <http://masapi.googlecode.com/svn/trunk/bundles/svn/>
>
> Let me know if you have any other problem !
>
> Regards,
> Cedric
>

chezl...@free.fr

unread,
Jan 16, 2009, 1:23:48 PM1/16/09
to masapi
Hello,

I have the same problem. Remember, I have post questions about
masapi....
I am going to finish my project now. But I did not understand where
can I set the MassLoader.alwaysDispatchProgressEvent to 'true' ?

Thank you.

Cédric Tabin

unread,
Jan 16, 2009, 1:27:18 PM1/16/09
to mas...@googlegroups.com, chezl...@free.fr
Hello,

If you're using a CompositeMassLoader, you can simply do it like this :

var cml:CompositeMassLoader = new CompositeMassLoader();
var massLoader:MassLoader = cml.massLoader as MassLoader;
massLoader.alwaysDispatchProgressEvent = true;

Remember that you don't have this problem if you're using the last revisions on the SVN :)

Regards,
Cedric

chezl...@free.fr

unread,
Jan 19, 2009, 1:21:54 PM1/19/09
to masapi
Ok, I understand. It is work very well now.
Thank you. I am going to download the last version.

See you
Ludo

On Jan 16, 7:27 pm, Cédric Tabin <tabin.ced...@gmail.com> wrote:
> Hello,
>
> If you're using a CompositeMassLoader, you can simply do it like this :
>
> var cml:CompositeMassLoader = new CompositeMassLoader();
> var massLoader:MassLoader = cml.massLoader as MassLoader;
> massLoader.alwaysDispatchProgressEvent = true;
>
> Remember that you don't have this problem if you're using the last revisions
> on the SVN :)
>
> Regards,
> Cedric
>
Reply all
Reply to author
Forward
0 new messages