Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-12-2008, 06:46 PM   #1
SergeantFlash
Member
 
SergeantFlash's Avatar
 
Join Date: Jul 2008
Posts: 90
Default problem with simple preloader

I made a preloader for one of my games, but it only appears when the swf is 90% loaded. I have three frame in my game, on frame 1, I have this code (the code for the preloader, plus some extra):
ActionScript Code:
stop(); //-----setup custom context menu before preloader-----\\ var menuItem1:ContextMenuItem = new ContextMenuItem("Noob Cube v1.0",false,false,true); var menuItem2:ContextMenuItem = new ContextMenuItem("Quality:",true,false,true); var menuItem3:ContextMenuItem = new ContextMenuItem("Low",false,true,true); var menuItem4:ContextMenuItem = new ContextMenuItem("High",false,true,true); menuItem3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, qLow); menuItem4.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, qHigh); var customContextMenu:ContextMenu = new ContextMenu(); customContextMenu.hideBuiltInItems(); customContextMenu.customItems.push(menuItem1); customContextMenu.customItems.push(menuItem2); customContextMenu.customItems.push(menuItem3); customContextMenu.customItems.push(menuItem4); this.contextMenu = customContextMenu; function qLow(event:ContextMenuEvent):void {     //set low quality     stage.quality = StageQuality.LOW; } function qHigh(event:ContextMenuEvent):void {     //set high quality     stage.quality = StageQuality.HIGH; } //-----/setup custom context menu before preloader-----\\ //-----setup prelaoder-----\\ loadedBar.mask = loadedBarMask; 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;     myLoadText.text = Math.round(pct * 100) + "%";     loadedBarMask.width = pct * 2; } function onComplete(e:Event):void {     nextFrame(); } //-----/setup prelaoder-----\\
The size of the swf is 102 KB, with a frame rate of 120 FPS, I also set the load order to Top Down. Any help is appreciated, thanks in advance!
__________________
Robert K.
SergeantFlash is offline   Reply With Quote
Old 08-12-2008, 09:01 PM   #2
pj-co
Site Contributor
 
pj-co's Avatar
 
Join Date: Jun 2008
Location: Brooklyn
Posts: 360
Default

the actionscript on frame will only run after everything on frame 1 has loaded.

post if you need help figuring out the ways around this but I suspect you know how to dig around and find out
pj-co is offline   Reply With Quote
Old 08-13-2008, 05:18 PM   #3
SergeantFlash
Member
 
SergeantFlash's Avatar
 
Join Date: Jul 2008
Posts: 90
Default

I read THIS, but now my preloader starts at around 70%. I guess I'll have to use an external swf preloader.
__________________
Robert K.
SergeantFlash is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
really simple preloader problem RikerF22 ActionScript 2.0 2 07-06-2007 02:54 AM
preloader problem opivy1017 ActionScript 1.0 (and below) 9 10-09-2004 01:00 PM
Preloader Delay Problem mactaggart ActionScript 1.0 (and below) 2 08-06-2003 06:12 PM
Preloader problem with external movies ian27 Simple Stuff (Newbies) 16 04-17-2003 12:06 AM
simple preloader problem Pixel ActionScript 1.0 (and below) 7 02-04-2003 09:47 PM


All times are GMT. The time now is 05:22 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.