New York Design & Development Forums  

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

Notices

Reply
 
LinkBack Thread Tools
Old 03-28-2006, 05:44 PM   #1 (permalink)
Junior Member
Casual Browser
 
seco's Avatar
 
Join Date: Dec 2004
Age: 30
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, 07: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 04: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, 07:28 AM   #3 (permalink)
Administrator
Disciple
 
danielmichel's Avatar
 
Join Date: Feb 2003
Age: 29
Posts: 727
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
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- A list of resources for 3D Developers

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- A list of resources for design in motion with Adobe After Effects

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- Usefully resources for freelance web developers

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- Tips and discussion about search engine optimization

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- Tutorials submitted by ny-dev members

Last edited by danielmichel; 11-26-2006 at 04: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


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 12 05-30-2009 03:36 PM
Simple website templates... Brighteyes Website Design & Layout 1 12-28-2006 06:03 PM
Photoshop: Quick button tutorial blaze_187 Tutorials 5 04-24-2006 02:22 PM
Flash and ASP quick example. Cota Tutorials 0 03-26-2006 02:31 AM
Swishmax Preloader Help Prequial Website Design & Layout 5 12-07-2004 02:54 PM


All times are GMT -4. The time now is 01:10 PM.


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

1 2 3 4 5 6 7 8 9 10 11 12 13