Skip to main content
December 22, 2011
Question

AS3 AIR question

  • December 22, 2011
  • 1 reply
  • 2599 views

Hi

I have a desktop AIR app that sends vars to a php page, which then rewrites a new css style file.  After the vars are uploaded, I set off a refresh function in AIR that refreshes an html display pane, so you can see the css style changes on the html page.

I was working great, but since I have changed hosts, I find I have to send the vars twice to see changes. 

I thought maybe the problem was that AIR was displaying the new page before php had a chance to write the new css file, but even after putting a 2 second delay timer on the refresh, the problem still exists.

I have also made the refresh function  URL request append date and time as in:

varSend2 = new URLRequest("http://www.blah.com/"?time=" + new Date().getTime());

Is there a trick to force the html display in AIR to display the new CSS settings first time around?

Thanks guys.

Shaun

This topic has been closed for replies.

1 reply

Kenneth Kawamoto
Community Expert
Community Expert
December 22, 2011

Download the CSS (possibly with a query string appended URL so that you get the new copy) first. When the load is completed download the HTML.

--

Kenneth Kawamoto

http://www.materiaprima.co.uk/

December 22, 2011

Gidday Kenneth

So download the CSS to AIR?  The HTML pane I'm using is just a display that loads an online webpage - I'm not actually using HTML in AIR.  So my programs updates the CSS on the server, and then displays the HTML page.  So I'm not sure how  downloading CSS would fit in with it.  The page gets it's CSS from the server.  Would you be kind enougho elaborate please?

Thanks

Kenneth Kawamoto
Community Expert
Community Expert
December 23, 2011

AIR is using cached old CSS, so if you download the new one AIR should use the new CSS - that's my theory.

--

Kenneth Kawamoto

http://www.materiaprima.co.uk/