RE: [flexcoders] ProgressBar and cached images problem

2005-05-25 Thread Matt Horn





One solution is to add a unique string to the tail of the 
image's URL, so the browser thinks it's a new image and goes and fetches it on 
every request(rather than returning it from the local cache). This fix is 
based on a related thread a week or two ago. The downside is that you dont get 
the benefit of the local cache. 

Here's an example that illustrates it:

?xml version="1.0" 
encoding="utf-8"?mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" 
initialize="doLoad()" 
mx:Script![CDATA[ var xxx:String; 
 public function doLoad() { 
 xxx = 
"?CacheBuster="+Math.random(); 
myImage.source = "http://www.icv2.com/images/144699Curseofwererabmd.jpg" 
+ xxx; } 
]]/mx:Script mx:ProgressBar 
source="myImage" / mx:Image id="myImage" 
/ !-- this is just so you can see what is 
being generated: --
 mx:Label text="{xxx}" 
//mx:Application

HTH,

matt 
horn
flex 
docs



  
  
  From: flexcoders@yahoogroups.com 
  [mailto:[EMAIL PROTECTED] On Behalf Of Kristopher 
  SchultzSent: Tuesday, May 24, 2005 6:14 PMTo: 
  flexcoders@yahoogroups.comSubject: [flexcoders] ProgressBar and 
  cached images problem
  
  Hey guys and 
  gals,
  
  I've stumbled 
  upon a quirky behavior I'm hoping you can help me resolve.
  
  The ProgressBar 
  component does not appear to work properly if the graphic asset being loaded 
  is in the browser's cache. The simple example below illustrates this problem. 
  The first time this app is displayed the ProgressBar properly tracks the 
  loading of the image. But on subsequent browser refreshes, the image loads 
  justfinebut the ProgressBar remains at 0%. If the browser cache is 
  cleared and the app is reloaded the ProgressBar once again works 
  properly.
  
  Is this a known 
  issue? How do I work around this problem?
  
   Example 
  
  
  ?xml 
  version="1.0" 
  encoding="utf-8"?mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" 
  initialize="doLoad()"
  
   mx:Script 
  ![CDATA[ public function 
  doLoad() { 
  myImage.source = "http://somedomain.com/someImage.jpg"; 
  } ]] 
  /mx:Script
  
   mx:ProgressBar source="myImage" 
  / mx:Image id="myImage" 
  /
  
  /mx:Application
  
  
  
  Kris
  
  -- 
  
  Kristopher Schultz
  Developer
  
  Resource Interactive
  p: 614.410.2123
  www.resource.com
  







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










Re: [flexcoders] ProgressBar and cached images problem

2005-05-25 Thread Manish Jethani
On 5/25/05, Kristopher Schultz [EMAIL PROTECTED] wrote:

 The ProgressBar component does not appear to work properly if the graphic
 asset being loaded is in the browser's cache. The simple example below
[...]

That odd.  Anyway, here's a workaround:

mx:Image id=myImage complete=progressbar.mode = 'manual';
progressbar.setProgress(100, 100) /

When the image dispatches a complete event, set the progress to 100.


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] ProgressBar and cached images problem

2005-05-24 Thread Kristopher Schultz





Hey guys and 
gals,

I've stumbled upon 
a quirky behavior I'm hoping you can help me resolve.

The ProgressBar 
component does not appear to work properly if the graphic asset being loaded is 
in the browser's cache. The simple example below illustrates this problem. The 
first time this app is displayed the ProgressBar properly tracks the loading of 
the image. But on subsequent browser refreshes, the image loads 
justfinebut the ProgressBar remains at 0%. If the browser cache is 
cleared and the app is reloaded the ProgressBar once again works 
properly.

Is this a known 
issue? How do I work around this problem?

 Example 


?xml 
version="1.0" encoding="utf-8"?mx:Application 
xmlns:mx="http://www.macromedia.com/2003/mxml" 
initialize="doLoad()"

 
mx:Script 
![CDATA[ public function 
doLoad() { 
myImage.source = "http://somedomain.com/someImage.jpg"; 
} ]] 
/mx:Script

 
mx:ProgressBar source="myImage" / 
mx:Image id="myImage" /

/mx:Application



Kris

-- 

Kristopher Schultz
Developer

Resource Interactive
p: 614.410.2123
www.resource.com








Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.