Flash + Flex

User avatar
Crisium
Level 7 - Spellcaster
Posts: 71
Joined: 13 Mar 2008, 17:57
Location: Odense C
Contact:

Flash + Flex

Unread post by Crisium » 17 Jul 2010, 22:11

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
kind regards,
Peter Wraae Marino

http://www.osghelp.com - support site for OpenSceneGraph

Zacker
Level 53 - Syntax error
Posts: 536
Joined: 12 Mar 2008, 15:18
Contact:

Re: Flash + Flex

Unread post by Zacker » 18 Jul 2010, 00:11

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.

User avatar
Crisium
Level 7 - Spellcaster
Posts: 71
Joined: 13 Mar 2008, 17:57
Location: Odense C
Contact:

Re: Flash + Flex

Unread post by Crisium » 18 Jul 2010, 00:19

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
kind regards,
Peter Wraae Marino

http://www.osghelp.com - support site for OpenSceneGraph

Gorm
Level 24 - Cyber demon
Posts: 243
Joined: 10 Mar 2008, 00:11
Location: London, UK
Contact:

Re: Flash + Flex

Unread post by Gorm » 18 Jul 2010, 10:23

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.
Gorm - Senior Creative Technologist
Blog
Twitter
Global Game Jam

Christen
Level 13 - Portal opener
Posts: 138
Joined: 02 May 2008, 13:44
Location: København

Re: Flash + Flex

Unread post by Christen » 18 Jul 2010, 19:39

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.

User avatar
Crisium
Level 7 - Spellcaster
Posts: 71
Joined: 13 Mar 2008, 17:57
Location: Odense C
Contact:

Re: Flash + Flex

Unread post by Crisium » 18 Jul 2010, 19:42

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
kind regards,
Peter Wraae Marino

http://www.osghelp.com - support site for OpenSceneGraph

nixudos
Level 0 - Null
Posts: 1
Joined: 11 Aug 2010, 11:42

Re: Flash + Flex

Unread post by nixudos » 11 Aug 2010, 11:52

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!

User avatar
Crisium
Level 7 - Spellcaster
Posts: 71
Joined: 13 Mar 2008, 17:57
Location: Odense C
Contact:

Re: Flash + Flex

Unread post by Crisium » 11 Aug 2010, 11:54

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
kind regards,
Peter Wraae Marino

http://www.osghelp.com - support site for OpenSceneGraph

ofktoubro
Level 0 - Null
Posts: 4
Joined: 26 Sep 2010, 23:12

Re: Flash + Flex

Unread post by ofktoubro » 26 Sep 2010, 23:36

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 :)

User avatar
Crisium
Level 7 - Spellcaster
Posts: 71
Joined: 13 Mar 2008, 17:57
Location: Odense C
Contact:

Re: Flash + Flex

Unread post by Crisium » 27 Sep 2010, 08:50

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
kind regards,
Peter Wraae Marino

http://www.osghelp.com - support site for OpenSceneGraph

gwiz665
Level 0 - Null
Posts: 8
Joined: 09 Mar 2010, 12:50
Location: Aarhus
Contact:

Re: Flash + Flex

Unread post by gwiz665 » 01 Nov 2010, 11:24

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.
Nicki Thomas Hansen
Senior Developer @ Kiloo

User avatar
Crisium
Level 7 - Spellcaster
Posts: 71
Joined: 13 Mar 2008, 17:57
Location: Odense C
Contact:

Re: Flash + Flex

Unread post by Crisium » 01 Nov 2010, 11:25

Hi,

I am using a flash debugger :)

doesn't solve the problem.

regards,
Peter
kind regards,
Peter Wraae Marino

http://www.osghelp.com - support site for OpenSceneGraph

Post Reply