18 August 2009
I’ve just run into two issues for Flex module loading. Maybe it helps somebody…
Hungry garbage collector
When loading modules, it’s important that you keep a reference to the IModuleInfo instance. I did store them in a Vector and thought everything works that way. What I forgot was a subtle timing issue: I checked the Vector for loaded modules after I pushed a new loading job into Vector. So it could happen that right after pushing the job into Vector, it got thrown into the garbage.
Stale Expires HTTP headers
Another nice one are HTTP caching headers: By mistake, I assigned all Flex modules a fixed Expires HTTP header. It expired this morning and loading modules became a seemly random process: The first module loaded successfully, but the second and third failed. When the same Flash Player instance loaded the module a second time, everything worked well. Well, after some debugging, I found the culprit in the HTTP header. After removing the Expires header, everything runs smoothly again.
Let me know if you have other stories about module loading.
Leave a Comment » |
Flash Player, InternetExplorer, actionscript, firefox, flex |
Permalink
Posted by Marc
18 April 2008
I’m developing a Flex application that runs smoothly in Firefox over SSL. Today, I just wanted to verify whether Internet Explorer 7 (IE7) hosts the application as nicely. Somehow, I wasn’t surprised that the Microsoft browser invoked an “Error #2032: Stream Error”.
Don’t assume, test!
Searching brought me to judah’s blog, but the blog is only about URL paths. Because the application runs in Firefox and in non-SSL mode in IE7, this was not causing my problem. However, some comments on judad’s blog and on this blog were interesting: An Adobe TechNote warns of this issue. However, the note was last updated in 2005 what meant that it could not relate to IE7. I also found a Microsoft bug report describing the issue but it only links the bug to IE5 and below. The assumption that Microsoft has corrected this bug since 2005 was probably my biggest mistake in this hole story.
The search could go on. Barton has some nice input and proposes to tamper the HTTP header: remove Pragma and set Cache-Control: no-store. So I did and checked the HTTP headers in the SSL connection with Wireshark (which is also quite bogus for decrypting SSL packets, at least 1.0.0). This made the whole thing running. And in details:
Works:
- Cache-Control: no-store
- Cache-Control: no-store, must-revalidate
- Cache-Control: no-store,max-age=0,must-revalidate
- Cache-Control: max-age=0,must-revalidate
- Cache-Control: must-revalidate
Does not work:
- Pragma: no-cache <+whatever header like Cache-control: no-store>
- Cache-control: no-cache
- Cache-control: no-cache, must-revalidate
- Cache-control: no-cache,<+whatever>
- <empty = no Cache-control at all>
Controlling Cache-Control
In Firefox, you can check the content of the cache by entering about:cache in the URL. You will notice that Firefox caches all data coming from an SSL connection in memory. Hence, closing a tab does not delete the data but a restart of Firefox does.
IE7 caches data coming from SSL normally to the disk. The HTTP header Cache-Control: no-store prevents this default behaviour. Unfortunately, I don’t know a similar command like about:cache in IE7, so haven’t investigated the exact caching behaviour. Cache stored on the disk can be checked with “Tools menu > Internet Options > General Tab > Browsing History section > Settings Button >View Files button” but I don’t know how to see the cache in the memory.
29 Comments |
InternetExplorer, actionscript, browser, firefox, flex |
Permalink
Posted by Marc
19 July 2007
- Press Ctrl and the class or method becomes a hyperlink that brings you with a click to its declaration. The other option is pressing F3.
- Tab flipping like in Firefox: Window > Preferences > General > Keys > View then in category “Window”, find “Next Editor” and assign Alt+Tab to the command. Don’t forget to really add the key sequence.
- I have always two Eclipse windows: One for the client in the Flex Perspective and the other for the server in the Java Perspective. You can do this with a right click onto the Java-Project and choosing “Open in new Window”
- For performance reasons, I had to disable subclipse. Eclipse became very slow recently.
- For digging libraries, I like to see the type hierarchy: F4 helps.
- Ctrl+H is the information desk. “Select resources” cuts the time for the search down.
- [Update] Like in Acrobat Reader or FireFox, you can skip to your last position with Alt+<-
- [Update] Reading the source of the some Flex components came be very helpful: You get the class browser with Ctrl+Shift+T.
- [2nd Update] I just learned about Dash that remains me of Greasmonkey. You can write your own little scripts in any Eclipse project. EOkyere shows a useful script for creating getter/setters in ActionScript with only writing var test:String.
And here a quickie for FREE in Firefox
Use Quick Searches! When I want to know how much fat a radish has, I type in Firefox:
- F6: brings me to the URL field
- wp radish
- = it’s 1g per kg
You can do this for the Flex search or any other site that allows to insert the search term in the URL. For Wikipedia,
- Create a bookmark in the “Quick Searches” folder
- Open the properties of this bookmark
- Insert in Location: http://en.wikipedia.org/wiki/Special:Search?search=%s
- Insert in Keyword: wp
- et finito
Maybe Google could integrate this feature in a personalized search? So I only have to use one input field for searching.
Leave a Comment » |
Flex Builder, actionscript, eclipse, firefox, flex |
Permalink
Posted by Marc
3 June 2007
Today, I definitely got fed up with this page:

Why is it annoying?
- I always read feeds in Google Reader, hence I never need to make a choice between the Google Homepage and the Reader.
- Quite often, I only want to see the xml. This is not possible on this page.
So here’s the fix:
- Go to the configuration in Firefox: Type about:config in your url field
- Search for browser.contentHandlers.types.2.uri
- Set it to http://www.google.com/reader/view/feed/%s
- Restart Firefox
- And everything is again as it used to be…
2 Comments |
browser, firefox, google |
Permalink
Posted by Marc