Connect
To Top

FLASH OPEN SOURCE: Preloader driven animation

I know it has been way, way too long since I have uploaded any new open source to any of my sites. I used to have a better balance between design and production/actionscripting but lately have been concentrating almost entirely on design and I wanted to get things back in balance. I have started work again on the new version of my portfolio site, have been sprucing up this blog and have been coding again.

I started back in with this simple file that uses a preloader to control the progress of a timeline animation. In this case the couch animation is broken up into eight parts and each part will only play once the corresponding percentage has been loaded. If the whole file loads right away like in this case the animation will play straight through. The best way to see it in action is download the file, publish it and run the ‘simulate download’ under the View option.

The heart of the script looks like this –

p = Math.round((_root.getBytesLoaded()/tkb)*100);
// This calculates the amount of the file that has loaded in bytes and concerts it to a percentage.

// This uses the range calculated what part of the animation should be played.
if (p >= 90) {
this.couch.targetnum = 8;
} else if (p <= 89 and p >= 80) {
this.couch.targetnum = 7;

and so on. This runs in a loop until the file is loaded and it goes on to play the transition to the image.

Download for Mac | Download for PC

You must be logged in to post a comment Login

Leave a Reply

More in Digital culture

Creative Director, Designer, Brand Builder, Speaker, Podcaster, Crazy One. As a designer, I have 20+ years experience creating the strategy, concepts, and designs for award-winning integrated global advertising campaigns, building multiple global Fortune 500 brands and creating innovative digital experiences. As a leader, I have 15+ years transforming agency and client-side teams using a mix of creativity, business strategy, process and political skill to create innovative, world-class work and cultures that change industries and companies. My clients have included American Airlines, W Hotels, Disney, Citi, ExxonMobil, Acura, Old Navy, Nationwide Insurance, Verizon, Subaru and many others. My work has received over 150 international awards, my app designs have been named as one of the World’s 100 Greatest Apps, Apple has featured my work in 9 keynotes, 4 TV commercials and more.

Follow me on Twitter

Copyright © 2015 Stephen Gates