Category: Flex

  • Static initalizer in Actionscript 3

  • Make object as Bindable in Flex/AIR

    Try use ObjectProxy instead of Object.

  • Reflection Container in Flex/AIR

    <s:VGroup id=”reflectionContainer” x=”50″ y=”50″ gap=”0″> <s:BitmapImage id=”image” source=”{Harbor}” x=”50″ y=”50″ width=”400″ height=”200″/> <s:BitmapImage source=”{Harbor}” scaleY=”1″ alpha=”.4″ width=”{image.width}” height=”{image.height}”/> </s:VGroup> src: Flex 4 Fun p.no : 67

  • Without press ctrl key select multiple item on list based control ?

    Extend list control

  • How to hide/disable copy/paste option in context menu on spark TextArea in Adobe AIR

    Just try with this protected function editor_rightMouseDownHandler(event:MouseEvent):void { if((editor.textDisplay as RichEditableText) != null && (editor.textDisplay as RichEditableText).contextMenu != null) { ((editor.textDisplay as RichEditableText).contextMenu as ContextMenu).hideBuiltInItems(); ((editor.textDisplay as RichEditableText).contextMenu as ContextMenu).clipboardMenu = false; } } protected function editor_copyHandler(event:Event):void { event.preventDefault(); System.setClipboard(“”); Clipboard.generalClipboard.clear(); }

  • How to set scrollbar at left side for List component in Flex ?

    1) protected override function updateDisplayList( unscaledWidth:Number, unscaledHeight:Number ):void { super.updateDisplayList( unscaledWidth, unscaledHeight ); if( verticalScrollBar && verticalScrollBar.visible ) { verticalScrollBar.x = -verticalScrollBar.width; } } 2) [HostComponent(“spark.components.List”)] <!— The Scroller component to add scroll bars to the list. –> <!– left/right values are adjusted here to prevent the rolloverColor/selectionColor from overlapping onto the border. –> <s:Scroller…

  • How to disabling paste on spark TexInput ?

    <s:TextInput change=”if (event.operation is PasteOperation) (event.target as SkinnableTextBase).text = ” ” /> It will also work with TextArea. source : http://www.robertbak.com/

  • In Flex How to remove duplicates value in ArrayCollection ?

    notebookAC.filterFunction = removeDuplicateNoteBookById notebookAC.refresh(); var tmpObjPage:Object = new Object(); private function removeDuplicatePageById(item:Object):Boolean { if (!tmpObjPage.hasOwnProperty(item.page_id)) { tmpObjPage[item.page_id] = item; return true; } return false; } private function removeDuplicatesValue(element:*,index:int,array:Array):Boolean { return array.indexOf(element)== index; //Tricks here }

  • Refresh ItemRenderer in Spark

    1)myList.dataGroup.invalidateDisplayList(); 2)myList.itemRenderer = null; contentCollection = event.result as ArrayCollection; myList.itemRenderer = new ClassFactory(HListRenderer); 3)myList.dataProvider = null; pageTabBar.dataProvider = _modelLocator.pagesCollection;

  • Flex/Flash Builder Shortcut keys Collections

    Preference ==> General->Editor->Quick Diff -> For SVN Changes Ctrl+I ==> To indentation selected line Ctrl-L to navigate to a line number. Highlight a method & hit Ctrl-Shift-G to see all references to the method. Ctrl+Space Word completion. Ctrl+D  Deletes a selected line(s) of code. Alt+Arrow Up/Down Moves a selected line(s) of code either up or…