View ItemRendererFactory.as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////// | |
// | |
// Copyright 2009 Farata Systems LLC | |
// All Rights Reserved. | |
// | |
// NOTICE: Farata Systems permits you to use, modify, and distribute this file | |
// in accordance with the terms of the license agreement accompanying it. | |
// | |
//////////////////////////////////////////////////////////////////////////////// |
View gist:890676
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<mx:MenuBar | |
labelField="@label" | |
dataProvider="{ _menuDataProvider.menuitem }" | |
xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"> | |
<fx:Script> | |
<![CDATA[ | |
public function set main(items:Array) :void { updateMenu( _menuDataProvider.menuitem, items); } |
View gist:891377
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<mx:DataGrid width="100%" height="100%" | |
xmlns:mx="http://www.adobe.com/2006/mxml" > | |
<mx:Script> | |
<![CDATA[ | |
/** | |
* Array of localized, marker labels | |
*/ | |
public var availableMarkers : Array = [ ]; |
View gist:925645
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<annotations version="1.0"> | |
<metadata name="Dispatcher" description="Used to request injection of the root Swiz dispatcher (default) or the dispatcher for containing Swiz instance." > | |
<context name="variable" /> | |
<context name="setter" /> | |
<attribute name="scope" type="String" defaultValue="global" required="false" values="global,local," hint="string" /> | |
</metadata> |
View gist:941711
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utils.string | |
{ | |
/** | |
* Replaces all tokenized fields in target with field values from | |
* the fields datasource. With this routine, the mx StringUtils.substitute | |
* is no longer needed to achieve printf() functionality. | |
* | |
* Supplant is more powerful since it can resolve (on-demand) property chains | |
* when used as fields; e.g. user.name (as shown below). | |
* |
View gist:972665
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"properties,size,displayList" | |
.split(",") | |
.map( function ( item:String, index:int, array:Array ):uint { | |
switch( StringUtil.trim( item ) ) | |
{ | |
case "displaylist": return InvalidationFlags.DISPLAY_LIST; | |
case "size" : return InvalidationFlags.SIZE; | |
case "properties" : return InvalidationFlags.PROPERTIES; | |
default : throw new Error( "Unsupported invalidation option specified." ); | |
} |
View Chaining with Async Events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[EventHandler(event="DeviceEvent.LOAD_SUMMARY",properties="device,filters,forceLoad")] | |
/** | |
* Here is an example of Parallel chaining. Developers should not that the workflow() method returns | |
* IAsynchronousOperation to allow workflow() to be itself chained with other eventHandlers. | |
* | |
* - DeviceEvent extends AsynchronousEvent. | |
* - FunctionChainStep is also available | |
* | |
* Here we get Device Snapshot information (includes upTimes and durationInState) | |
*/ |
View gist:1017230
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------------------------------------------------------------------------------------ | |
/** | |
* Why CLOSURES are great! | |
* | |
* Think of Closures as Functions within Functions... where nested functions have access to parent function variables | |
* and arguments. So, you may ask? | |
* | |
* Closures allow developers to temporarily cache data! | |
* Closures can simplify recursion or iterations (aka visitors pattern) | |
* Closures can solve real-world `callback` problems; especially powerful for asynchronous callbacks. |
View gist:1019075
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add Popup Behavior to any Flex UI! | |
* | |
* 1) Want to show UI Components in Popup? | |
* 2) Want to use show/hide effects, autoClose, modality? | |
* 3) Want to use anchor constraints (top, right, etc.) to position the popup anywhere relative to ANY parent? | |
* 4) Want to position the popup relative to the mouse or any other specific location? | |
* 5) Want to cache the popup content for super-fast reuse ? | |
* 6) Want it super easy... with no need to worry about events or memory cleanup? | |
* |
View gist:1034340
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Using Popup Behavior with Swiz and registerWindow() | |
* | |
* Source is available on GitHub project: Flex-Extensions | |
* | |
* https://github.com/CodeCatalyst/flex-extensions/blob/develop/src/com/codecatalyst/component/behavior/ui/Popup.as | |
* | |
*/ | |
<?xml version="1.0" encoding="utf-8"?> |
OlderNewer