[Flashcoders] caching loaded swfs and jpegs

2007-09-07 Thread Andrew Sinning

I have 2 questions about the caching of loaded files:

I'm building a wrapper movie around the Loader and ProgressBar classes.  
During testing from within Flash, once I've loaded a file it remains 
cached by the Flash Player.  This makes it hard to test the loader.  
I've had to add a random number after the file name 
(?+String(Math.random()) in order to get a fresh download each time.  
Isn't there a better way to clear the cache?


Because I'm using AS2, I can't dynamically change the parent of a media 
clip when I need it, but I'd like to preload any anticipated media into 
a buffer clip before they actually get displayed in the UI.  So, if I 
load something into a buffer clip and then later load the same address 
into the UI clip, will the cached data be good to go?  There's probably 
a better way to do this.  I'm open to suggestions.


Thanks!

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] caching loaded swfs and jpegs

2007-09-07 Thread Hal Leonard
Andrew -

There's a cachebuster class put out by communityMX, but it basically just
encapsulates the random number. Some people do a random number based on the
date and time, but it all equates to roughly the same thing.

Hal

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew
Sinning
Sent: Friday, September 07, 2007 9:46 AM
To: Flash Coders
Subject: [Flashcoders] caching loaded swfs and jpegs

I have 2 questions about the caching of loaded files:

I'm building a wrapper movie around the Loader and ProgressBar classes.  
During testing from within Flash, once I've loaded a file it remains 
cached by the Flash Player.  This makes it hard to test the loader.  
I've had to add a random number after the file name 
(?+String(Math.random()) in order to get a fresh download each time.  
Isn't there a better way to clear the cache?

Because I'm using AS2, I can't dynamically change the parent of a media 
clip when I need it, but I'd like to preload any anticipated media into 
a buffer clip before they actually get displayed in the UI.  So, if I 
load something into a buffer clip and then later load the same address 
into the UI clip, will the cached data be good to go?  There's probably 
a better way to do this.  I'm open to suggestions.

Thanks!

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] caching loaded swfs and jpegs

2007-09-07 Thread Paul Venton
You could use:

var urlNoCache:String = (System.capabilities.playerType == External ? ?
+ getTimer(): );
  
Appending urlNoCache to your url will only add a string when played in an
external player or test movie.  Testing in anything else creates an empty
string.  Substitute getTimer with whatever random generator you choose.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew
Sinning
Sent: 07 September 2007 17:46
To: Flash Coders
Subject: [Flashcoders] caching loaded swfs and jpegs

I have 2 questions about the caching of loaded files:

I'm building a wrapper movie around the Loader and ProgressBar classes.  
During testing from within Flash, once I've loaded a file it remains 
cached by the Flash Player.  This makes it hard to test the loader.  
I've had to add a random number after the file name 
(?+String(Math.random()) in order to get a fresh download each time.  
Isn't there a better way to clear the cache?

Because I'm using AS2, I can't dynamically change the parent of a media 
clip when I need it, but I'd like to preload any anticipated media into 
a buffer clip before they actually get displayed in the UI.  So, if I 
load something into a buffer clip and then later load the same address 
into the UI clip, will the cached data be good to go?  There's probably 
a better way to do this.  I'm open to suggestions.

Thanks!

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com