New York Design & Development Forums

Go Back   New York Design & Development Forums > Knowledge Bank > Tutorials
Connect with Facebook

Notices

Reply
 
LinkBack (1) Thread Tools
Old 03-28-2006, 04:44 PM   1 links from elsewhere to this Post. Click to view. #1 (permalink)
Junior Member
Casual Browser
 
seco's Avatar
 
Join Date: Dec 2004
Age: 33
Posts: 17
seco is a glorious beacon of lightseco is a glorious beacon of lightseco is a glorious beacon of light
Send a message via AIM to seco Send a message via Yahoo to seco
Default Simple, quick preloader.

the first 2 frames,

actions layer, frame 1
Code:
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent*90;  //change this number to the MC length
if (bytes_loaded == bytes_total) {
    _root.gotoAndPlay(3);
}
actions layer, frame 2
Code:
gotoAndPlay(1);
frame 3 start the movie.


loadBar layer frame 1&2

make a rectangle, convert it to a Movie Clip and put the registration to the left side.

name its instance loadBar

EXAMPLE FLA FOR DOWNLOAD
seco is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Blink this Post!
Reply With Quote
Old 06-29-2006, 06:02 AM   #2 (permalink)
Junior Member
 
Join Date: Jun 2006
Posts: 1
jgraup is on a distinguished road
Smile Complex, one frame, eased preloader.

Even though your example is TIMELESS and utterly flawless, how might I do this with only one frame I asked myself?

So I tested out a ridiculous if statement wrapped in an interval – just for s#!xs and giggles. It seems to work with your fla if you comment out frame 1 & 2. I also pulled out a few variables so it’s a little easier to read – but you get the point. Enjoy!


actions layer, frame 1

Code:
stop();



var intMils = 30; // milliseconds til next update
var ease = .2; // ease factor
var len = 90; // final width
_root.loadBar._width = 0 // init value

// run check
var intCheck = setInterval( function() {
	if((_root.loadBar._width += Math.ceil((len*(((per=(_root.getBytesLoaded()/_root.getBytesTotal()))>=1)?1:per) - _root.loadBar._width)* ease  )) == (len) && _root.getBytesTotal() > 4) // rediculous if statement
	{
		clearInterval ( intCheck ); // clear this function
		_root.gotoAndPlay(2); // start the timeline
	} 
}, intMils );
- independent of framerate
- always smooth
- accounts for empty clips < 4 bytes
- one frame




or... the NON-EASE VERSION


Code:
	var intCheck = setInterval( function() { if((_root.loadBar._width = 90*(((per=(_root.getBytesLoaded()/_root.getBytesTotal()))>=1)?1:per)   ) >= (90) && _root.getBytesTotal() > 4){ clearInterval ( intCheck ); _root.gotoAndPlay(2); } }, 30 );

Last edited by danielmichel; 11-26-2006 at 03:45 AM.
jgraup is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Blink this Post!
Reply With Quote
Old 10-28-2006, 06:28 AM   #3 (permalink)
Administrator
Disciple
 
danielmichel's Avatar
 
Join Date: Feb 2003
Age: 31
Posts: 729
Images: 16
danielmichel is a glorious beacon of lightdanielmichel is a glorious beacon of lightdanielmichel is a glorious beacon of light
Send a message via AIM to danielmichel Send a message via MSN to danielmichel Send a message via Yahoo to danielmichel Send a message via Skype™ to danielmichel
Default Re: Complex, one frame, eased preloader.

Quote:
Originally Posted by jgraup
Even though your example is TIMELESS and utterly flawless, how might I do this with only one frame I asked myself?

So I tested out a ridiculous if statement wrapped in an interval – just for s#!xs and giggles. It seems to work with your fla if you comment out frame 1 & 2. I also pulled out a few variables so it’s a little easier to read – but you get the point. Enjoy!


actions layer, frame 1

Code:
stop();



var intMils = 30; // milliseconds til next update
var ease = .2; // ease factor
var len = 90; // final width
_root.loadBar._width = 0 // init value

// run check
var intCheck = setInterval( function() {
	if((_root.loadBar._width += Math.ceil((len*(((per=(_root.getBytesLoaded()/_root.getBytesTotal()))>=1)?1:per) - _root.loadBar._width)* ease  )) == (len) && _root.getBytesTotal() > 4) // rediculous if statement
	{
		clearInterval ( intCheck ); // clear this function
		_root.gotoAndPlay(2); // start the timeline
	} 
}, intMils );
- independent of framerate
- always smooth
- accounts for empty clips < 4 bytes
- one frame




or... the NON-EASE VERSION


Code:
	var intCheck = setInterval( function() { if((_root.loadBar._width = 90*(((per=(_root.getBytesLoaded()/_root.getBytesTotal()))>=1)?1:per)   ) >= (90) && _root.getBytesTotal() > 4){ clearInterval ( intCheck ); _root.gotoAndPlay(2); } }, 30 );
The best first and only post i've ever seen
__________________
3D Resources - A list of resources for 3D Developers
After Effects Resources - A list of resources for design in motion with Adobe After Effects
Freelance Resources - Usefully resources for freelance web developers
Search Engine Optimization - Tips and discussion about search engine optimization
Tutorials - Tutorials submitted by ny-dev members

Last edited by danielmichel; 11-26-2006 at 03:46 AM.
danielmichel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Blink this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://forums.ny-dev.com/f184/simple-quick-preloader-435/
Posted By For Type Date
PHP: Custom user authentication - ny-dev | Design & Development Forums This thread Refback 01-03-2010 03:10 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX: Simple Tutorial seco Tutorials 20 10-28-2011 05:58 AM
Swishmax Preloader Help Prequial Website Design & Layout 6 06-30-2011 12:01 PM
Simple website templates... Brighteyes Website Design & Layout 1 12-28-2006 05:03 PM
Photoshop: Quick button tutorial blaze_187 Tutorials 5 04-24-2006 01:22 PM
Flash and ASP quick example. Cota Tutorials 0 03-26-2006 01:31 AM


All times are GMT -4. The time now is 09:53 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45