Page 1 of 1

Flash + Flex

Posted: 17 Jul 2010, 22:11
by Crisium
Hi users,

I have the for last 14 days been trying to teach myself flash + flex.. everything is going well (and pretty easy)... but
I have major problems with the browser caching the swf making it hard for me to do changes and see the result.

I have surf the entire internet and I can see this is a common problem, but funny enough nobody has a valid solution for it. Does anyone know how to solve this problem.

regards,
Peter

Re: Flash + Flex

Posted: 18 Jul 2010, 00:11
by Zacker
It's been a while since my Flash days, but I do indeed remember that issue. If I remember correctly I think the forced refresh (ctrl+f5) did help, you can try that.

Re: Flash + Flex

Posted: 18 Jul 2010, 00:19
by Crisium
Zacker wrote:It's been a while since my Flash days, but I do indeed remember that issue. If I remember correctly I think the forced refresh (ctrl+f5) did help, you can try that.
Hi Zacker,

yea.. I have tried that too.. without luck :(

the only thing that really works is going into the "options" and clearing the cache... but this kinda' sux because it clears cache for everything... but it works 100%

regards,
Peter

Re: Flash + Flex

Posted: 18 Jul 2010, 10:23
by Gorm
I am not sure if you are only using Action Script 3 (ie only the flex parts). If so, in the past, I have just used FlashDevelop to code my stuff in, and it starts up an external .swf viewer so no need to use a browser and it also gets rid of the reload problem.

I only needed to start the browser, when tampering with the html page hosting the flash file.

Re: Flash + Flex

Posted: 18 Jul 2010, 19:39
by Christen
What Gorm said

Or..

If you are using a browser use firefox. Use ctrl+delete and enter then you clear the cash. You can also choose what in cash you want to clear. So you only clear downloaded files, not passwords cookies asf. Another option is to put something after the flash file you are loading. IE. something.swf?randaomstuff=12312 which should force your browser to get a new version.

Re: Flash + Flex

Posted: 18 Jul 2010, 19:42
by Crisium
Christen wrote:What Gorm said

Or..

If you are using a browser use firefox. Use ctrl+delete and enter then you clear the cash. You can also choose what in cash you want to clear. So you only clear downloaded files, not passwords cookies asf. Another option is to put something after the flash file you are loading. IE. something.swf?randaomstuff=12312 which should force your browser to get a new version.
Hi Christen,

I've tried the adding a random generated parameter in... Flex uses an index.template.html file... it doesn't work. but to be fair I don't see the url parameters in the console when it loads the swf.. so I really don't know if it is processing the index.template.html file correctly... other areas in the index.template.html are generated correctly (I'm sending flashVars) and they come just fine

Peter

Re: Flash + Flex

Posted: 11 Aug 2010, 11:52
by nixudos
You usually need to clear your cache to be sure you get the latest swf. I made it a habit always to clear and the close and reopen the browser when testing Flex projects. Might be overkill but then I know for sure it is the right swf I'm testing.

Sometimes it might not be the browser that is the issue, but that the swf weren't able to compile because of errors. To verify if that is the case you can manually delete the swf in the "bin-debug" folder and see if Flex can build a fresh one.

Best of luck!

Re: Flash + Flex

Posted: 11 Aug 2010, 11:54
by Crisium
nixudos wrote:You usually need to clear your cache to be sure you get the latest swf. I made it a habit always to clear and the close and reopen the browser when testing Flex projects. Might be overkill but then I know for sure it is the right swf I'm testing.

Sometimes it might not be the browser that is the issue, but that the swf weren't able to compile because of errors. To verify if that is the case you can manually delete the swf in the "bin-debug" folder and see if Flex can build a fresh one.

Best of luck!
Hi Nixudos,

it is the browser.. the browser is doing what a browser should do (just a pain when developing). Clearing the cache every time is a pain.. and it also clears the cache for everything not just the swf file, so it's a very bad work-around.

I still haven't found a solution that is acceptable yet...

regards,
Peter

Re: Flash + Flex

Posted: 26 Sep 2010, 23:36
by ofktoubro
Yeah it is the browser cache - you can solve it by making the browser "think" it is a new file everytime it loads by appending a random value when you load the swf.

You want to end up with something like this:
"yourswf.swf?4385656783"

That means you need to load with something like this (from within flash):

Code: Select all

"yourswf.swf?"+OnTheFlyGeneratedRandomValue
This can be done in your preloader and might also work directly in your html file...
The latter will require php (or somthing like that) and look somthing like this:
"yourswf.swf?value="+<?php <?php echo mt_rand(); ?>

Does that makes sence? (...or somthing :)

Re: Flash + Flex

Posted: 27 Sep 2010, 08:50
by Crisium
ofktoubro wrote:Yeah it is the browser cache - you can solve it by making the browser "think" it is a new file everytime it loads by appending a random value when you load the swf.

You want to end up with something like this:
"yourswf.swf?4385656783"

That means you need to load with something like this (from within flash):

Code: Select all

"yourswf.swf?"+OnTheFlyGeneratedRandomValue
This can be done in your preloader and might also work directly in your html file...
The latter will require php (or somthing like that) and look somthing like this:
"yourswf.swf?value="+<?php <?php echo mt_rand(); ?>

Does that makes sence? (...or somthing :)
Hi,

yea I understand what you doing.. and I have tried that method.. still doesn't work.
it seems the cache systems are much smarter.

regards,
Peter

Re: Flash + Flex

Posted: 01 Nov 2010, 11:24
by gwiz665
I'm confused. Is it that you want to debug/test your code and do it in the browser? or is it a "final" that you put online or something?

Regardless, if you are debugging you should use a flash debugger http://www.adobe.com/support/flashplayer/downloads.html
"Download the Windows Flash Player 9 Projector content debugger" and set windows to open swf files with that exe.

When you finally embed it into a html page, then you can do the ctrl+reload to make a hard reload of the swf file.

Re: Flash + Flex

Posted: 01 Nov 2010, 11:25
by Crisium
Hi,

I am using a flash debugger :)

doesn't solve the problem.

regards,
Peter