So continuing on this post I took a gander at Flex > Preferences > Keys to get my command-f11 key working… with success! Under the list of keyboard shortcuts about halfway down the “>Category<” column is Run/Debug. The command “Run Last Launched” is mapped to Command-F11 as it should be but under the “When” column it is set to “In Windows”. Not sure what all “In Windows” entails but I edited this shortcut adding a new “When” to this shortcut found under the drop down list called “Editing Flex Source” and bam, functional command-f11. Sure beats the kung-fu move of a keyboard shortcut mentioned in my last entry.
 
OMG. For over 2 years I’ve launched Flex by mousing over to the little bug icon and clicking. I’ve done it so often its become second nature. All because I took one look at this cryptic glyph sequence, tried to guess..tecute it, then gave up to pretend this shortcut didn’t exist.
After a brief stint back in the Flash IDE–instantly returnign to hitting command-enter to debug, I came back to Flex with the determination to slay this gnarly shortcut sequence once and for all. And here’s the secret:
That up arrow icon is shift. Thats an easy one. The bizzare serif-X-with-one-leg-missing glyph represents alt/option. Yeah I don’t understand that either. Then there’s the letter “D” and “F”. Naturally, hitting all 4 together does nothing. But wait, see the slight excess kerning between those 2 letters? Thats a space. It means let go of the current key combination before hitting the next letter. And there it goes.
Why 4 keys in 2 combinations just to debug your project? Seams a little absurd for one of the most important and common shortcuts. Is every other normal key combination really taken? Really? I’m using the Eclipse plugin version of Flex btw, but I assume its the same with the stand alone.
Did anyone else have trouble with this? Don’t make me feel stupid and annoyed all by myself :P
UPDATE: Figured out how to get the more straight forward command-f11 shortcut working here
Haven’t been posting too frequently, been pretty busy at KickApps working on the Widget Studio. I’d like to write about it in another entry at another time but for now I’d like to help expose a pretty vicious bug we’ve encountered during the course of developing this app.
The Widget Studio is a Flex based WYSIWYG widget generator who’s end product is embed code for widgets. The embed src points to a server side redirect that returns our main SWF file with some variables appended to it. These variables have to be dynamic to pass things like the build version number (cache control) and refferal url to the swf. After much debugging we realized if querystring variables are appended to the redirect in <embed src=”"/> then variables attached to the swf from inside the redirect do not get passed to the SWF in IE. After much googling, these are the only 2 entries we could find on the matter:
MSDN forum post
JW Player (?) forum post
If both appended-to-redirect and inside-redirect variables are neccessary, the only viable answer is a rest style architecture to pass variables to your SWF (assuming, like in our case, the appended-to-redirect variables can’t be moved to flashVars as they are used by the redirect script itself)
Cleaning out the wordpress there were a few posts I hadn’t finished. This one is mainly a for-future-reference for myself.
I’ve been doing some run-time class loading involving loading SWF files into the same ApplicationDomain as the container via Loader then using getDefinitionByName to access new instances of the loaded classes. I was perplexed that the INIT and COMPLETE events weren’t being dispatched and found some info here.
Always interesting to throw an error that has only 4 obscure results in google.
Using setTimeout with navigateToURL:
var urlRequest
:URLRequest =
new URLRequest("http://google.com");
setTimeout(navigateToURL, 1000, urlRequest
, "_blank");
Generates:
SecurityError: Error #2000: No active security context.
at global/flash.net::navigateToURL()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at <anonymous>()
at SetIntervalTimer/onTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
A work around is to wrap the call in an anonymous function:
setTimeout(function():void { navigateToURL(urlRequest, “_blank”); }, 1000);