• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

A good simple preloader.

Explorer ,
Jul 31, 2012 Jul 31, 2012

Copy link to clipboard

Copied

I've asked some questions regarding this before on a project I had to put on the backburner.  But I'm back to that project now and am looking at it with new fresh eyes so I thought I'd bring it up again in a new discussion.  I'm working on a Flash website, using Actionscript 3 in Flash cs5.5.  I need a preloader...one that loads and opens a seperate swf.  I got some help putting some code together to make a preloader like this and it works but I'd like to make one more visually pleasing. 

Can anybody either give me advice or possibly point me towards a tutorial that will teach me to make a preloader with a some sort of loading graphic, like a status bar or something(doesn't have to be anything too crazy) that will load and open another swf?  I've found tutorials in the passed that show how to make status bars and stuff but they're all coded to load another frame within the same swf, which isn't what I want and I don't know my way around as3 well enough to modify it for what I need.

The key here really is I want it to be simple.  I'm not an actionscript whiz by any stretch. 

thanks guys!

TOPICS
ActionScript

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 31, 2012 Jul 31, 2012

I believe this meets your requirements, and is a preferred approach...

AS3 Preloader
-------------

http://www.gotoandlearn.com/play.php?id=85

Votes

Translate

Translate
LEGEND ,
Jul 31, 2012 Jul 31, 2012

Copy link to clipboard

Copied

I believe this meets your requirements, and is a preferred approach...

AS3 Preloader
-------------

http://www.gotoandlearn.com/play.php?id=85

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 01, 2012 Aug 01, 2012

Copy link to clipboard

Copied

Thanks, this is helpful and will definately do the trick.  I'd love to be able to add a status bar to it though.  Any tips on that?  He alludes to being able to add graphics like that but doesn't elaborate.  My actionscript knowledge is for the most part pretty basic so it's hard to launch into something like that without some guidance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 02, 2012 Aug 02, 2012

Copy link to clipboard

Copied

LATEST

If you look at the loop function in the code he provides, that is what you will use to control things like a loading bar... the key being to understand and make use of the perc value that is being calculated. 

You can use the perc value to control the scaleX of something, such as a status bar...

yourStatusBar.scaleX = 0;  // a starting value for your status bar

function loop(e:ProgressEvent):void

{

    var perc:Number = e.bytesLoaded / e.bytesTotal;

    percent.text = Math.ceil(perc*100).toString();

    yourstatusBar.scaleX = perc;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines