So I’ve been using Snipplr recently for storing little code snippets. Looks like a pretty good service but after I tested its embedding features recently in a couple of posts I got sad and started to cry. This is because it didn’t embed very well. Not very well at all. You couldn’t scroll the code horizontally to read it.
Well, I’ve now installed the Snipplr wordpress plugin so hopefully the next bunch of stuff you see will be a couple of Snipplr snippets nicely embedded with some lovely scrolly-pollys scrollbars. Ok, I’ll stop talking like a baby now.
Get the server/domain name that your SWF is running on
- /*
- In Flex the Application needs to be complete so run this code within your applicationComplete event handler and pass a Boolean into a Data model somewhere so you can use it elsewhere.
- */
- var Flex3Application:String = URLUtil.getServerName(Application.application.loaderInfo.url);
- var Flex4Application:String = URLUtil.getServerName(FlexGlobals.topLevelApplication.loaderInfo.url);
Detecting if your SWF is running over HTTP or locally
- /*
- In Flex the Application needs to be complete so run this code within your applicationComplete event handler and pass a Boolean into a Data model somewhere so you can use it elsewhere.
- */
- var isLocal:Boolean = loaderInfo.url.indexOf("file") == 0;
There’s a TextMate bundle too.
Exciting ay? The fun never stops here!


Recent Comments