Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-15-2003, 10:02 AM   #41
Warrior
Victory Is Mine
 
Warrior's Avatar
 
Join Date: Apr 2003
Location: Earth
Posts: 1,233
Default

I told you I have another preloader to reveal a picture bit by bit and when the picture if fully revealed, the movie begins.
ActionScript Code:
onClipEvent (enterFrame) {     Total = Math.round(_root.getBytesTotal()/1000);     Loaded = Math.round(_root.getBytesLoaded()/1000);     Percent = (Total)/(Loaded) *100;     if (Picture._currentframe<Percent) {         Picture.play();     } else {         Picture.stop();         if (Percent == 100) {             _root.play();         }     } }
All you do is put a picture inside a movie clip and mask it and animate the mask to reveal the picture to 100 frames. If people are confused I can upload a Flash file
Warrior is offline   Reply With Quote
Old 08-15-2003, 10:06 AM   #42
retrotron
thinking is design
 
retrotron's Avatar
 
Join Date: Apr 2003
Location: UK
Posts: 1,292
Default

7 will most likely have a movieclip preloader API, won't that be great! Until then, keep these preloaders coming.
retrotron is offline   Reply With Quote
Old 08-15-2003, 12:49 PM   #43
jbruton
Registered User
 
Join Date: Feb 2003
Posts: 2
Default Can you say what's happening here?

Hey all...

I too am "stumped" by preloaders.

In my case, I'm building and XML file on the fly and the trying to preload a set of images based on that data.

In my attached files, I'm only loading two, but it shows the gist of what I'm trying to do.

I THINK the preload part is working, but I'm not sure.

Two questions:

One - why can't I get an actual number for getBytesLoaded() and/or getBytesTotal()? (I tried to output/view using getURL)

Two - why can't I resize these images after they're loaded?

Big thanks to all of you who take time out of your day to help an egghead like me...
Attached Files
File Type: zip imagepreloader.zip (73.6 KB, 926 views)
jbruton is offline   Reply With Quote
Old 08-25-2003, 05:24 PM   #44
Motion2082
Flash Developer
 
Motion2082's Avatar
 
Join Date: Mar 2003
Location: Australia
Posts: 476
Default

Well we have covered a lot of Preloaders in this thread.

I still think there are more hiding out there somewhere

Hope this forum has helped all those in the Actionscript community. It would be nice to see more Actionscript threads like this one. Not only do we solve one problem but we cover every angle which saves this section of the forum from becoming overloaded with the same problems.

Obviously actionscript is a complicated language, one which takes years to master, having said that every little bit counts
Motion2082 is offline   Reply With Quote
Old 09-09-2003, 05:22 AM   #45
Ericinho
Registered User
 
Join Date: Sep 2002
Location: Pays-Bas
Posts: 196
Default

found this link:

http://www.actionscripthero.com/blog...ing_images.php

scroll down the page to find a list of more preload resources throughout the web.

man, this thread deserves a sticky
Ericinho is offline   Reply With Quote
Old 09-09-2003, 07:31 AM   #46
Motion2082
Flash Developer
 
Motion2082's Avatar
 
Join Date: Mar 2003
Location: Australia
Posts: 476
Default

@ Ericinho

OMG what an absolutely amazing link

Thank you so much for your contribution
Motion2082 is offline   Reply With Quote
Old 09-09-2003, 09:07 AM   #47
avelives
"the dude abides..!"
 
avelives's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 365
Send a message via AIM to avelives Send a message via Yahoo to avelives
Default

this one is very simple but works when dropped at start of any movie so quite versatile.

ActionScript Code:
this.onEnterFrame = function() {     if (this.getBytesLoaded()<this.getBytesTotal()) {         Total = this.getBytesTotal()/1000;         Received = this.getBytesLoaded()/1000;         percent=(Received/Total)*100;     } else {         _root.preload.play();         this.onEnterFrame = null;     } } stop();

obviously you would add some sort of command to utilise the percentage number, like _xscalei used it on my home page and it even preloads dynamic jpegs (dont ask me how)
avelives is offline   Reply With Quote
Old 09-09-2003, 09:29 AM   #48
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: Egyptian in UAE
Posts: 12,436
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

I didn't see Eric's link but since Flash MX, most of the time I use setInterval() for preloaders
__________________
‚€* GOD Is Near ‚€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI

Last edited by farafiro; 09-10-2003 at 03:36 AM.
farafiro is offline   Reply With Quote
Old 09-09-2003, 09:23 PM   #49
Motion2082
Flash Developer
 
Motion2082's Avatar
 
Join Date: Mar 2003
Location: Australia
Posts: 476
Default

@ farafiro

Would you be able to provide an example of your setInterval() script for your preloader?

Also if you get a spare sec look at Rric's link, it will take you about half a day to get through all the useful resources but very worthwhile if you have a spare couple of hrs
Motion2082 is offline   Reply With Quote
Old 09-10-2003, 12:11 AM   #50
retrotron
thinking is design
 
retrotron's Avatar
 
Join Date: Apr 2003
Location: UK
Posts: 1,292
Default

Here's avelives's code modified a la setInterval():
ActionScript Code:
this.preloadThis = function() {         if (this.getBytesLoaded()<this.getBytesTotal()) {                 Total = this.getBytesTotal()/1000;                 Received = this.getBytesLoaded()/1000;                 percent=(Received/Total)*100;         } else {                 _root.preload.play(); // can modify this to play whatever                 clearInterval(this.preloadInterval);         } } this.preloadInterval = setInterval(this, "preloadThis", 100); this.stop();
retrotron 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 12:24 AM.

///
Follow actionscriptorg on Twitter

 


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