progbar and loader components won't work in 6.

progbar and loader components won't work in 6.

Post by Holger Fit » Wed, 18 Aug 2004 00:20:25

here is another problem with the loader component:
I'm using the loader component (actually the form-class which extends loader)
to load external SWFs (also form-based). I use the
complete- and progress-event listener to track the download of the forms. In
the authoring enviroment, when simulate
download is on, the preloader works correct, it loads the external forms with
a progress-bar (ATTENTION: Loader.percentLoaded doesn't work here, instead I
use load.current and (undocumented) - example code is attached)

It works also with Mozilla Firefox (0.93 here) and Opera (tested with 7.5).
But in IE6 the loader component fires the complete-event immediately. there are
no progress-events and therefor my loaderbar doesn't work.

I googled around and here is a similar problem: %24i43%241%40forums

import mx.controls.*;

class myForm extends mx.screens.Form
private var pBar:ProgressBar = null;

function LoaderForm() {
addEventListener("load", this);

private function handleEvent(evtObj:Object):Void {
if(evtObj.type == "reveal") { pBar.visible = true; }
if(evtObj.type == "progress") { pBar.setProgress( evtObj.current, ); }
if(evtObj.type == "complete") { pBar.visible = false; }

if(evtObj.type == "load") { loaderLoad(); }

private function loaderLoad():Void {
pBar = ProgressBar( createClassObject(mx.controls.ProgressBar, "pBar", 10) );

ref.form1.contentPath = "subform.swf";
ref.form1.autoLoad = true;
ref.form1.visible = true;

ref.form1.addEventListener("progress", this);
ref.form1.addEventListener("reveal", this);
ref.form1.addEventListener("complete", this);