Category Archives: ActionScript

  • Designer Effects for Flex

    Posted on January 15, 2010 by in ActionScript, Blog, Flex, Flex Note

    Efflex is a good site providing a number of custom effects for Flex. http://www.efflex.org/orgefflexmxviewstackeffects/ Here is the Effect Explorer by Efflex. You can preview all the effects and try to customize the effect options. http://www.efflex.org/EfflexExplorer.html

    2 Comments. Continue Reading...
  • Flash / Flex application: Can’t type chinese character

    Posted on August 3, 2009 by in ActionScript, Blog, Flex, Flex Note

    If you have added parameter “wmode” (e.g. opaque, transparent) into the flash application object tag in the HTML. You may not able to type non-English character into the text input of the flex application by using non-IE browsers. <object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ id=”flashapp” width=”100%” height=”500″ codebase=”http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab”> <param name=”movie” value=”teacher.swf” /> <param name=”quality” value=”high” /> <param name=”bgcolor” value=”#869ca7″ [...]

    No Comments. Continue Reading...
  • Using hand cursor in Flex Text control

    Posted on July 16, 2009 by in ActionScript, Blog, Flex, Flex Note

    By default, the flex application can show hand cursor when rollover by enabling useHandCursor and buttonMode properties. However, in Text control, the cursor will not change to hand even you set the selectable = false. The tricky thing is that we have to set its mouseChildren to false also. <mx:Text useHandCursor=”true” buttonMode=”true” mouseChildren=”false” /> mouseChildren [...]

    4 Comments. Continue Reading...
  • Flex MultiLine FormItem

    Posted on June 18, 2009 by in ActionScript, Blog, Flex, Flex Note

    This is a very good control to break the form item label into multiple lines. I found it from Google by Nick bilyk. http://www.nbilyk.com/multiline-formitem-label http://www.nbilyk.com/examples/betterFormItemExample/index.html

    3 Comments. Continue Reading...
  • Multiline TabNavigator #2

    Posted on April 20, 2009 by in ActionScript, Blog, Flex, Flex Note

    MultiLineTab.as package controls { import flash.display.DisplayObject; import flash.text.TextLineMetrics; import mx.controls.tabBarClasses.Tab; import mx.core.IFlexDisplayObject; import mx.core.UITextField; import mx.core.mx_internal; use namespace mx_internal; public class MultiLineTab extends Tab { public function MultiLineTab() { super(); } override protected function createChildren():void { if (!textField) { textField = new UITextField(); textField.styleName = this; addChild(DisplayObject(textField)); } super.createChildren(); textField.multiline = true; textField.wordWrap = true; [...]

    6 Comments. Continue Reading...
  • Corelib

    Posted on April 16, 2009 by in ActionScript, Blog, Flex, Flex Note

    CORELIB有一堆UTILITIES … 有陣時都幾好用~~ http://code.google.com/p/as3corelib/ http://weblogs.macromedia.com/as_libraries/docs/corelib/com/adobe/utils/package-detail.html

    No Comments. Continue Reading...
  • Flex Multiline TabNavigator

    Posted on April 16, 2009 by in ActionScript, Blog, Flex, Flex Note

    Currently, if your label text is too long. The text will be truncated as “…” in the tab. However, there are very few posts talking about how to build a multiline tavnavigator in flex. And the flex API does not provide a style and properties to do such styling. We have to create custom classes. [...]

    3 Comments. Continue Reading...
  • ActionScript 2 External Interface

    Posted on April 8, 2009 by in ActionScript, Blog, Flash

    前幾日打算寫個flash button 點知office得flash 8, 要用actionscript 2 … 真係幾挑戰..因為自己未用過8 + as 2 當初諗住好似好簡單既野.. 用external interface call js 點知攪左好耐都唔得.. 最後搵到個site 先幫到我.. 要將 ExternalInterface.call(); 改做 flash.external.ExternalInterface.call(); 先用到.. 但係我真係唔明 =.=  唔通佢有兩個api 都係叫 ExternalInterface ?!  算啦…應該都唔會點用as 2 架啦.. Reference: http://www.psyked.co.uk/actionscript/externalinterface-not-working-in-firefox.htm

    No Comments. Continue Reading...
  • Copying an ArrayCollection

    Posted on August 24, 2008 by in ActionScript, ArrayCollection, Flex Note

    There are multiple ways to copy an arraycollection .. 1. ac1 = ac2;2. ac1 = new ArrayCollection (ac2.source);3. ac1 = ObjectUtil.copy (ac2) as ArrayCollection; Method 1 copy the ac by reference.Method 2 will create an new ac instance, but the value (array) inside two ac are still the same.Method 3 will create completely two different [...]

    6 Comments. Continue Reading...
  • Dynamic source of Image control

    Posted on August 24, 2008 by in ActionScript, Flex Note, Image

    In order to change the image source dynamically instead of creating multiple image instances, we could make use of [Embed] tag as follows: [Embed(source="a.png")]private var _src_a:Class;[Embed(source="b.png")]private var _src_b:Class; _img = new Image ();if ( … ) { _img.source = _src_a;} else { _img.source = _src_b;} http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000968.html

    2 Comments. Continue Reading...