Loading Multiple SWFs

  • Arsenikdote
  • Born
  • Born
  • Arsenikdote
  • Posts: 3
  • Loc: OR, USA

Post 3+ Months Ago

Hello,

I am new to this site but have seen a lot of good info here. I am designing my first flash site and have a question for you "in the know" =) I have several SWFs that I have created. I have one for the main site w/Nav and the others 6 sections each have their own intro swf and then main swf for the sub-page. I got some code from another site and am having problems with it. My question is, I want to pre-load some of the swf so that there is no lag when clicking on a link. But I want to do this as soon as the main site is loaded w/no "loading" I got some code I thought would do this, but it leaves the loaded swf behind instead of getting rid of it, so in essance it displays it early. Can someone take a look and let me know if I can do it with this code? Thanks!

this.createEmptyMovieClip("holder",1);

holder.loadMovie("subpage.swf");

this.onEnterFrame=function(){

percent=(this.holder.getBytesLoaded()/this.holder.getBytesTotal())*100;
if(!isNan(percent)){
trace(percent+"% loaded");
}else{
trace("0% loaded");

}
if(percent == 100){
delete this.onEnterFrame;
}
}
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • .soulty
  • Novice
  • Novice
  • User avatar
  • Posts: 23
  • Loc: Lost in Sydney

Post 3+ Months Ago

not being a AS guru or anything, but since no one else has attempted i'll suggest something.

You maybe able to hide the mc holder

//after on enter frame.
so when it loads you can hide the mc
Code: [ Select ]
this.holder._visible=false;


till when you need it you can show it by using
Code: [ Select ]
this.holder._visible=true;


also i suggest including a stop action before your intro animation starts and that you have a frame label in your external swf's named "intro" in which when you call the mc holder to be visible you can tell flash to also
Code: [ Select ]
holder.gotoAndPlay("intro");
which will play the intro you have created.

hope this can help you.
cheers.
.soulty
  • Arsenikdote
  • Born
  • Born
  • Arsenikdote
  • Posts: 3
  • Loc: OR, USA

Post 3+ Months Ago

.soulty

Thanks for the response! I will try that, I had done the first frame thing and was getting an undesirable flash of white when it loaded the movie. I thought I had tried to hide the mc, but I will give it another try and give the results. Thanks again!
  • Arsenikdote
  • Born
  • Born
  • Arsenikdote
  • Posts: 3
  • Loc: OR, USA

Post 3+ Months Ago

I have added:
this.holder._visible=false;

I have put it between...
holder.loadMovie("subpage.swf");


and this...
this.onEnterFrame=function(){

When I put this in my "home" movie and execute that code the "preload" movie starts to play and you see it. I think because the mc is being hidden but not the movie that it is loading...or something. Anyway, I also will try the stop frame again to see if I can get better results.
  • .soulty
  • Novice
  • Novice
  • User avatar
  • Posts: 23
  • Loc: Lost in Sydney

Post 3+ Months Ago

im confused, ok where is your preloader located? and where is this code you mentioned above situated?
  • .soulty
  • Novice
  • Novice
  • User avatar
  • Posts: 23
  • Loc: Lost in Sydney

Post 3+ Months Ago

did you have any luck with it?

if not , maybe you can post your file/s , zip them up, just the fla's and ill see if i can help.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 8 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.