PDA

View Full Version : question about loading external swfs!


PengPhooie
06-29-2005, 05:38 AM
yeah, I've probably posted this 3 times now, so what... I still cant get this to work the way I need...

anyway, I have this site (a flash file) that loads an swf (a little thing of text and picture that gets updated) and whenever I updated it, it didn't show untill I cleared my cache... well that was before... now it loads the new ones, but it loads them even when it isn't new... which is bad for bandwidth/loadtimes...

so, I made a couple adjustments to the code I had which was:

loadMovie("banner.swf", spot);

complex eh? well, I later got some advice to make a random number that checks something or other... I really better just show it to you:

r = Math.random()*1000000000000
loadMovie("banner.swf?r="+r, spot);

that wasn't it exactly, but you get the point. it loaded every chance it got...

now I've taken a while and made a sort of thing that uses an external text file that I change that has version numbers and it loads into a movie clip in my main file. it works. yay. but I cant find a way to tell what the version variable is inside the file to be loaded... so, here is what I have:

ver = _root.ver.bannerversion
loadMovie("banner.swf?_root.ver="+ver, spot);

and inside my little thing to be loaded I have:

_root.ver=1

that is in the first frame on the frame itself...

now, I need to know what I'm doing wrong so I can stop wasting my money on a domain that has "coming soon" on it :(

thanks

Stu
06-29-2005, 07:51 AM
all this is to solve the problem of flash "caching" swf's?

were you just hitting refresh or actually closing the browser and re-opening?

if you close and reopen the browser window (ie, a new "visit" to the site), the flash should recheck and load the latest version

PengPhooie
06-29-2005, 08:06 AM
that works with swfs loaded into a page with html, but not swfs loaded into other swfs... and I cant imagine why flash has to be gay like that. maybe they will fix this in the next version of flash... but we can only hope...

PengPhooie
06-29-2005, 10:17 PM
so, no one is going to help me here? there has to be someone here that knows what I'm doing wrong...

PengPhooie
06-30-2005, 11:26 PM
I have already posted this question 3 times on other parts of this forum, so now I'm putting it here in hopes that it will be answered.

anyway, I have this site (a flash file) that loads an swf (a little thing of text and picture that gets updated) and whenever I updated it, it didn't show untill I cleared my cache... well that was before... now it loads the new ones, but it loads them even when it isn't new... which is bad for bandwidth/loadtimes...

so, I made a couple adjustments to the code I had which was:

loadMovie("banner.swf", spot);

complex eh? well, I later got some advice to make a random number that checks something or other... I really better just show it to you:

r = Math.random()*1000000000000
loadMovie("banner.swf?r="+r, spot);

that wasn't it exactly, but you get the point. it loaded every chance it got...

now I've taken a while and made a sort of thing that uses an external text file that I change that has version numbers and it loads into a movie clip in my main file. it works. yay. but I cant find a way to tell what the version variable is inside the file to be loaded... so, here is what I have:

ver = _root.ver.bannerversion
loadMovie("banner.swf?_root.ver="+ver, spot);

and inside my little thing to be loaded I have:

_root.ver=1

that is in the first frame on the frame itself...

now, I need to know what I'm doing wrong so I can stop wasting my money on a domain that has "coming soon" on it :(

thanks

flyingchalupa
07-01-2005, 12:09 AM
Well, one way to do it would be to rename the actual files themselves with a version number...
So like:


fileVer = _root.ver.bannerversion
loadMovie("banner"+fileVer +".swf", spot);


Also, be careful having to variables named 'ver'.. Or overwritting them... But I assume this was just an example?

Cheers...

PengPhooie
07-01-2005, 12:27 AM
originally I was going to do that, but I decided not to, and now I cant even remember why....

I should make it easyer on myself and number them like you said :|

thanks for helping me realize this xD