Yellow Page
Yellow Page

Reputation: 51

Get updated image in flex image control after changing source not name of file(image)?

I am changing image through flex every time i change it saved into server directory with same name(which i am referring to show). So when i refresh my page my browser didn't send new request to server since it's already in request.so didn't getting new image.Tip:- when i clear browser history it will come with new image

Upvotes: 1

Views: 599

Answers (2)

Angelo
Angelo

Reputation: 1666

Since you mentioned that you're refreshing the browser, then I assume that your embedded SWF file will also need to be refreshed.

When you embed your SWF, you need to add a parameter that would be random across all time (i.e. datetime stamp, etc.)

var mySWF = "swf/YourEmbeddedFlashFile.swf?guid=" + rnd();

and declare a js function:

function rnd() 
{
  return String((new Date()).getTime()).replace(/\D/gi, '')
}

Upvotes: 1

Subodh
Subodh

Reputation: 2214

You can try adding an additional time-stamp to the image source each time u make a new request, which would make the request look different for the browser.

Example :

var src:String = "image.png";
src = src  + "?" + new Date().getTime().toString(); 

Upvotes: 1

Related Questions