Be a Supporter!

lash preloader pissing me off

  • 228 Views
  • 1 Reply
New Topic Respond to this Topic
ThomSip
ThomSip
  • Member since: Aug. 19, 2007
  • Offline.
Forum Stats
Member
Level 12
Game Developer
lash preloader pissing me off 2010-10-24 09:12:20 Reply

Hey peepz,

Flash has been bugging me real bad lately. I just want to add a preloader, here's the code for the preloader which stand on frame1 of the main timeline.

this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, PL_LOADING);
function PL_LOADING(event:ProgressEvent):void 
{
	var pcent:int=event.bytesLoaded/event.bytesTotal*100;
	loadBar.gotoAndStop(pcent);
	if(pcent==100 && gameLocked == false)
	{
		loaded = true;
		loadTxt.gotoAndPlay("loaded")
	}
}

However, when I tried to load the movie, the preloader starts at 100% (very usefull -.-) This happens even though I load all the music (which is like 95% of the game file) on frame 2.

Now I could just make flash load all external classes on frame 2. But this gives me 2 problems, 1) I cant put adds on the preloader since they won't work without the external files. 2) I get thius error:

ReferenceError: Error #1065: Variabele loading_5 is niet gedefinieerd.

I've been looking everywhere, But I can't even find a variable called loading_5

Anyone know whats up? :(


My flash games, and cool zombie games. Also I am Thom Sip!

BBS Signature
MichaelJ
MichaelJ
  • Member since: Mar. 2, 2009
  • Offline.
Forum Stats
Member
Level 18
Voice Actor
Response to lash preloader pissing me off 2010-10-24 10:13:08 Reply

Maybe you could download the Newgrounds preloader and customize it/build off of that code?


BBS Signature