Forum Moderators: open

Message Too Old, No Replies

Flash menu cache!

         

smagdy

9:50 am on Jun 23, 2005 (gmt 0)

10+ Year Member



hi,
Ive flash menu and when I click any button in the menu for first time after i open the browser..

For ex. "Home" then it loads the page as new uncached page.. but if i clicked on "Home" again anytime then it just brings the cached page so the php data never gets updated unless i do "REFRESH" or close and open new browser!

so how to overcome this?

thanks in advance

Richard_N

1:40 pm on Jun 23, 2005 (gmt 0)



you can add a randon number to the variable your parsing by way of Math.random

smagdy

2:36 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



i really dont get it.. what the relation of the random numbers to what i want?

can u clear it more?

Richard_N

2:45 pm on Jun 23, 2005 (gmt 0)



If you asign a randon mumber to the variable being called then a cached version of that particular request will not exist so flash will have to go and hunt for it, so a fresh version of the variable will aways be displayed

in actionscript 1 its

loadVariables("whatever.txt?" + int(Math.random * 10000), this);

actionscript 2 will require a different syntax which if you really want I will work out for you :-)

smagdy

5:52 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Thanks a lot i hope u can help me but i dono if am using action script 1 or 2.. But it doesnt say anything wrong if i export the file while marking action script 1 + my code is very simple for each button its just..

on (rollOver) {
gotoAndPlay(2);
}
on (releaseOutside, rollOut) {
gotoAndPlay(14);
}
on (release){
getURL("/pagename");

}

so where should I add what?

thanks again

smagdy

5:59 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



BTW I dont load variables i just get url and of course i cant append to the page name any random number ..

so whats the solution?

Richard_N

7:37 pm on Jun 23, 2005 (gmt 0)



so the idea is to open a URL in a seperate or same window with updated data from the php element of that URL?

If so cant see why he php is not being parsed at render time, not sure how flash comes into it really. Surely its down to the php page or even the browser settings?

Are you trying to parse information to the PHP pge from within flash or is it simply a standard open page command?

vincevincevince

7:38 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



e i cant append to the page name any random number ..

Yes you can. Just ask for it with a? first.

widget.woo/widgets.html?random=12231432432

Won't make any difference to content but will kill the cache problem.

smagdy

7:51 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



am just trying to open a page from flash menu button.. and it works well but just the cache problem.

---------

am optimizing the page using mod rewrite, so for ex.

when the menu button is clicked i go to

"mobiles" which internally go to "mobiles.php?bla=1"

so i dont think it will work if i added random number to "mobiles"

smagdy

8:01 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Any normal link works fine with the cache but not flash buttons..

This is exactly what am doing:

-------------------------------------
Flash button:

on (release){
getURL("/pagename");
}
-------------------------------------

goes to

-------------------------------------
.htaccess:

RewriteRule ^pagename$ pagename.php?cat=1
-------------------------------------

am using Flash MX 2004

Richard_N

9:54 pm on Jun 23, 2005 (gmt 0)



try bypassing mod rewrite and put the real path name in the flash?

we link to php pages here from flash without any problems.

smagdy

10:37 am on Jun 24, 2005 (gmt 0)

10+ Year Member



I didnt try it yet cuz am not around my flash file so will do it after few hours..

but i wana ask.. There is no way to accomplish what i want except by bypassing the mod rewrite thing?

I mean i want to have my pages URL optimized
thanks

smagdy

11:50 am on Jun 26, 2005 (gmt 0)

10+ Year Member



anybody?

Richard_N

2:23 pm on Jun 26, 2005 (gmt 0)



well one non-flash cheat would be to send the flash link to a url which then does an instant redirect through the mod rewrite... but as this stuff is not really my thing there may be a better way.