![]() |
| |
#1 (permalink)
|
| Junior Member Casual Browser | 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);
}
Code: gotoAndPlay(1); 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 |
| | |
| | #2 (permalink) |
| Junior Member Join Date: Jun 2006
Posts: 1
![]() | 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 );
- 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. |
| | |
| | #3 (permalink) | |
| Administrator Disciple | Quote:
__________________ 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. | |
| | |
![]() |
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 | |
| |
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 |