Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-22-2003, 11:09 AM   #1
Simon Turner
oh the pain ... 8^|
 
Join Date: Aug 2001
Location: Warwickshire UK
Posts: 35
Send a message via ICQ to Simon Turner
Default preloading twist!

Hi

The coding below works fine for preloading the entire .swf before making it available within the main presentation, but occassionally I have need to only preload half the content because by the time the main presentation has called up and gone through its 'launching' sequence - the rest of the .swf has time to load, so to make the loading faster, how would I go about altering the code to do just this?

//this preloader is in a .swf that is called up via the main .swf at the very start and put on 'hold' until it called into action by the viewer with a button press/release.

ActionScript Code:
total_bytes = _root.getBytesTotal();  loaded_bytes = _root.getBytesLoaded();  percent_done = int((loaded_bytes/total_bytes)*100);  var loadAmount = _totalframes;  if (_framesloaded == loadAmount) {      gotoAndPlay(3);      _level0.nextFrame();  }

I would also like to keep the % counter, but give the illusion that when it says 100% loaded, actually only 50% has.

Thanks for your time to read this, I am sorry I dont make many posts, but I am rather basic in my knowledge and all the easy questions are already answered by the time I see them. Still, next time this question is posted, maybe I can help out too

Last edited by Simon Turner; 04-22-2003 at 11:17 AM.
Simon Turner is offline   Reply With Quote
Old 04-23-2003, 07:39 AM   #2
jayouk
Registered User
 
jayouk's Avatar
 
Join Date: Dec 2002
Location: Dublin / UK
Posts: 50
Send a message via AIM to jayouk
Default

I would think you would use

if (_framesLoaded == 50) {

_root.gotoAndPlay(3);
}


Just substitute _totalframes for a number of frames
jayouk is offline   Reply With Quote
Old 04-23-2003, 08:49 AM   #3
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

try this
ActionScript Code:
total_bytes = _root.getBytesTotal(); loaded_bytes = _root.getBytesLoaded(); percent_done = Math.round((loaded_bytes/total_bytes)*100); if (loaded_bytes>= (total_bytes/2)) { //either chose one of these two lines         gotoAndPlay(3); // _level0.nextFrame(); }
__________________
€* GOD Is Near €*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 04-23-2003, 08:43 PM   #4
Warrior
Victory Is Mine
 
Warrior's Avatar
 
Join Date: Apr 2003
Location: Earth
Posts: 1,233
Default

Hey farafiro,
why did you divide by 2 in this line,

ActionScript Code:
if (loaded_bytes>= (total_bytes/2)) {
Warrior is offline   Reply With Quote
Old 04-24-2003, 09:20 AM   #5
Simon Turner
oh the pain ... 8^|
 
Join Date: Aug 2001
Location: Warwickshire UK
Posts: 35
Send a message via ICQ to Simon Turner
Default

thanks for the responses - I shall try them all and post which had the best results .

Simon Turner is offline   Reply With Quote
Old 04-29-2003, 06:20 AM   #6
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

Quote:
Originally posted by Warrior
Hey farafiro,
why did you divide by 2 in this line,
ActionScript Code:
if (loaded_bytes>= (total_bytes/2)) {
for this line that Simon wrote:
Quote:
I would also like to keep the % counter, but give the illusion that when it says 100% loaded, actually only 50% has.
__________________
€* GOD Is Near €*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 05-01-2003, 02:47 PM   #7
Simon Turner
oh the pain ... 8^|
 
Join Date: Aug 2001
Location: Warwickshire UK
Posts: 35
Send a message via ICQ to Simon Turner
Default

Hello again

The code does indeed make the counter finished when 50% of the .swf is loaded, but the counter only counts to 50% when really I would like to give the impression that 100% has in fact been loaded.

I used farafiro's coding.

This is the url of the site in question:

www.fourseasonscraftfayres.co.uk
Simon Turner is offline   Reply With Quote
Old 05-04-2003, 06:23 AM   #8
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

Quote:
Originally posted by Simon Turner
Hello again
The code does indeed make the counter finished when 50% of the .swf is loaded, but the counter only counts to 50% when really I would like to give the impression that 100% has in fact been loaded.
u can change that in the preloader bar or the preloader text
just Math
__________________
€* GOD Is Near €*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 05-06-2003, 03:30 PM   #9
jaredly
Registered User
 
Join Date: May 2002
Location: Des Moines, IA
Posts: 158
Send a message via AIM to jaredly
Default try this

ActionScript Code:
total_bytes = _root.getBytesTotal()/2; loaded_bytes = _root.getBytesLoaded(); percent_done = int((loaded_bytes/total_bytes)*100); if (_loaded_bytes == total_bytes) {         gotoAndPlay(3);         _level0.nextFrame(); }

Give this a try.

Last edited by jaredly; 05-06-2003 at 03:53 PM.
jaredly 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 04:59 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.