AS3 Quickie: Check if a variable is Numeric

I’m still doing loads of ActionScript work in both my regular job and in side projects – so thought I might start posting some tiny, useful snippets of AS3 here as I encounter them. This is, I suppose, both for my own archive and for anyone out in the community that cares to pick up on these bits and pieces. So this quickie comes from a project where I actually have an AIR application running as a service on a Windows 2008 virtual machine. The application monitors a remote folder for uploads from a web application in order to process

Continue reading »

Creating Custom Context Menus in Flash

The assets for my 5 minute quick tip talk for the 2011 Adobe Education Leader Institute are located here. This is the completed example (Flash Professional CS5.5): [download AEL2011_FlashContextMenu] Here is an image preview: Here is the SWF: Flash Player 11.2 or greater is required! And here be the code bits! package { import flash.display.Sprite; import flash.ui.ContextMenu; import flash.ui.ContextMenuItem; import flash.ui.ContextMenuBuiltInItems; import flash.net.URLRequest; import flash.net.navigateToURL; import flash.events.ContextMenuEvent; public class CustomMenu extends Sprite { private const MENUITEM_FVM:String = “©2011 Fractured Vision Media, LLC”; private const MENUITEM_JOSEPH:String = “Joseph Labrecque”; public function CustomMenu(){ buildMenu(); } private function buildMenu():void { var myMenu:ContextMenu =

Continue reading »

Quick Tip: Display Application Version in your AIR App.

Just a quick tip for those looking to somehow display the AIR application version from the descriptor file. I’ve found it very helpful in troubleshooting is users can say EXACTLY what version of the app they are running. AIR 2.5 and later: private function getAppVersion():String { var appXml:XML = NativeApplication.nativeApplication.applicationDescriptor; var ns:Namespace = appXml.namespace(); var appVersion:String = appXml.ns::versionNumber[0]; return appVersion; } Older versions of AIR: private function getAppVersion():String { var appXml:XML = NativeApplication.nativeApplication.applicationDescriptor; var ns:Namespace = appXml.namespace(); var appVersion:String = appXml.ns::version[0]; return appVersion; }

Continue reading »