Skip to main content
Participating Frequently
August 10, 2009
Question

Problems in preLoader for exterior movieClips

  • August 10, 2009
  • 1 reply
  • 525 views

hi

i am trying to import a swf movieClip to my main stage, but since the swf contains large scale images, a added a preloader to it,

the preloader is in each swf, but when i load the swf to the stage of my main movie clip, sometimes it works fine and loads and some other time it doesn't!  Beloa is the preLoader that I am using:

stop();

addEventListener(Event.ENTER_FRAME,loading);

function loading(e:Event) {

var loaded = Math.round(stage.loaderInfo.bytesLoaded);//Download File Size

var total = Math.round(stage.loaderInfo.bytesTotal);//Total File Size

var getPercent = loaded/total;

preloading.txt.text = Math.round(getPercent*100);

if (loaded == total) {//File Download Finished Site or Project Open 2. frame

removeEventListener(Event.ENTER_FRAME,loading);

gotoAndPlay(2);

}

}

is the problem from the preloader or i have to add a code to the main swf to make it work properly?

anyone can give me a hand in solving this issue?

thanks

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
August 10, 2009

you should be seeing, at least, one compiler error.  do you?

Participating Frequently
August 10, 2009

hi

this is the link to the gallery that i am working on, http://webtemp2.idm.net.lb/selgallery/gallery.html

this is one of the errors when trying to access the 2nd category {{{TypeError: Error #1009: Cannot access a property or method of a null object reference.

at cat_a_fla::banner_container_10/update()}}}

now the problem is when you click the upper link, you will notice that the loaded swf preloader will appear for couple of seconds and then disappears, but the movieClip does't load to the stage,

If you click on the 2nd categorie and then comeback and click the 1st categorie the swf loads to the stage :S

really annoying

kglad
Community Expert
Community Expert
August 10, 2009

you can't expect anything to work correctly until you fix all your errors.  and you have more than 1.

the null reference error means you're trying to reference an object that doesn't exist.  to help pinpoint that object, click file/publish settings/flash and tick "permit debugging".  retest.  you'll now see a line number in your first (assuming the error you mentioned was the first) error message.  the line contains the object that doesn't exist.