Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Community Boards > Just for Kicks Challenges

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-03-2003, 03:33 AM   #1
padnpen
Buzzed off Mt. Dew
 
Join Date: Jun 2003
Location: Newport Beach, CA
Posts: 240
Send a message via Yahoo to padnpen
Default Challenge - Preloader

I'll give you the punch line, I'm not NEARLY as good as you are... you win. However, I was working on a preloader and wondered what magical creations others might come up with to put mine to shame. So... the challenge is to create a preloader that is better than mine (won't take much) in as many or fewer lines than mine. After seeing what has been done in 25 lines I don't think that will be a problem.

I tried to follow the rules of the challenges, at least in spirit. The only thing you need is a really large movie, which you should have one laying around somewhere, to test with. OK, here are my 32 lines of code... eager to be demolished!

ActionScript Code:
createBar = function (amount) {     createEmptyMovieClip("myText", 97);     with (myText) {         createTextField("preText", 98, 198, 155, 300, 100);         preText.text = percent+"% is loaded";}     createEmptyMovieClip("bar", 99);     with (bar) {         beginFill(0xff0000, percent);         lineStyle(1, 0x000000, 100);         moveTo(200, -50);         lineTo(206, -55);         lineTo(206, 0);         lineTo(200, 0);         lineTo(200, -50);         endFill();}     bar._visible = false;     for (i=0; i<amount; ++i) {         duplicateMovieClip("bar", "bar"+i, i);         setProperty("bar"+i, _y, 150);         setProperty("bar"+i, _x, i*8);         setProperty("bar"+i, _yscale, (i+1)*6);}}; onEnterFrame = function() {     percent = Math.round(getBytesLoaded()/getBytesTotal()*100);     if (percent == 100) {         for (i=0; i<Math.round(percent/10); ++i) {             removeMovieClip("bar"+i);         }         removeMovieClip("bar");         removeMovieClip("myText");         gotoAndStop(2);     } else {         createBar(Math.round(percent/10));}};

If this is a stupid idea I will officially boot myself from any further proceedings.
padnpen 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 Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:53 PM.


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