-
1. Re: Bizarre Problem
kglad Jun 8, 2009 10:41 AM (in response to Shane P)no progress event is being triggered when you return.
to remedy, either don't return to that frame or use a complete listener to trigger your advance to frame 2.
-
2. Re: Bizarre Problem
Shane P Jun 8, 2009 10:50 AM (in response to kglad)Thank you for the reply,
How would I set it up so after the movie loads and a user goes off on another page and decides to come back to the home page it will automatically go to frame 2 and not frame 1 and go through the preloader code? I fairly new to actionscripting so I apologize if I am sounding like an idiot...lol
-
3. Re: Bizarre Problem
kglad Jun 8, 2009 10:57 AM (in response to Shane P)you already have an onComplete function. just add:
stop();
var alreadyLoaded:Boolean;
if(alreadyLoaded){
onComplete(new Event("complete"));
}
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);function onProgress(e:ProgressEvent):void
{
var loaded:Number = e.target.bytesLoaded;
var total:Number = e.target.bytesTotal;
var pct:Number = loaded/total;
loader_mc.scaleX = pct;
loaded_txt.text="Loading..." + (Math.round(pct * 100)) + "%";
}function onComplete(e:Event):void
{alreadyLoaded=true;
gotoAndPlay(2);
} -
4. Re: Bizarre Problem
Shane P Jun 8, 2009 11:07 AM (in response to kglad)Thank you for the reply, ill try this now.
-
5. Re: Bizarre Problem
Shane P Jun 8, 2009 11:19 AM (in response to kglad)It did not work, its still doing it in firefox......arghhhhh....heres the code in my fla
stop();
var alreadyLoaded:Boolean;
if(alreadyLoaded){
onComplete(new Event("complete"));
}this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);function onProgress(e:ProgressEvent):void
{
var loaded:Number = e.target.bytesLoaded;
var total:Number = e.target.bytesTotal;
var pct:Number = loaded/total;
loader_mc.scaleX = pct;
loaded_txt.text="Loading..." + (Math.round(pct * 100)) + "%";
}
function onComplete(e:Event):void
{
alreadyLoaded=true;
gotoAndPlay(2);
} -
6. Re: Bizarre Problem
kglad Jun 8, 2009 11:56 AM (in response to Shane P)if your swf is not advancing to frame 2 then there's something else executing after that frame 1 code causing the problem. if you see a momentary flash of your preloader and you want that removed, then use:
stop();
var alreadyLoaded:Boolean;
if(alreadyLoaded){
gotoAndPlay(2);
} else {this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);}
function onProgress(e:ProgressEvent):void
{
var loaded:Number = e.target.bytesLoaded;
var total:Number = e.target.bytesTotal;
var pct:Number = loaded/total;
loader_mc.scaleX = pct;
loaded_txt.text="Loading..." + (Math.round(pct * 100)) + "%";
}
function onComplete(e:Event):void
{this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.removeEventListener(Event.COMPLETE, onComplete);
removeChild(loader_mc);
removeChild(loaded_txt);
loader_mc=null;
loaded_txt=null;
alreadyLoaded=true;
gotoAndPlay(2);
} -
7. Re: Bizarre Problem
Shane P Jun 8, 2009 12:13 PM (in response to kglad)Thank you so much for your help but unfortunately that didnt work either. Here is the site if you would like to see for yourself. www.signheredocs.com
-
8. Re: Bizarre Problem
kglad Jun 8, 2009 1:35 PM (in response to Shane P)i don't see a problem (except all those pages are slow to load).
-
9. Re: Bizarre Problem - Can a mod please delete this post please.
Shane P Jun 10, 2009 7:51 AM (in response to Shane P)Thank you
-
10. Re: Bizarre Problem - Can a mod please delete this post please.
kglad Jun 10, 2009 8:31 AM (in response to Shane P)you're welcome.




