Allmas

  • Increase font size
  • Default font size
  • Decrease font size

Flex 3 Regular Expression Explorer

E-mail Print PDF

If you ever worked with regular expressions, you know how difficult and time consuming it is sometimes to create and test them. Ryan Swanson released the Flex 3 Regular Expression Explorer to help you with this task. The explorer allows you to create and test regular expressions instantly and find common ones published by himself or by the community. It also features a simple reference to the ActionScript 3 regualr expressions syntax. Thanks Ryan!

 

Always override the clone() method for your custom events

E-mail Print PDF

When implementing a custom event in a Flash or Flex application, most examples and articles I found on the web don't override the clone() method. This works probably in most simple cases, but as soon as you try to redispatch the event (by calling dispatchEvent(event) in a handler that is handling event), you can get a "Type Coercion Failed" error. It states that it cannot convert flash.events.Event to your custom event's type.

Why is this happening? When you redispatch an event , the EventDispatcher class calls the clone() method and dispatches the cloned copy of the event. If you don't override the method to return an instance of the custom event, the original Event.clone() method will be called and an object of type Event will be returned. Now if you have an event listener expecting an instance of the custom event, the error will occur as the Flash virtual machine doesn't know how to convert from Event to your custom event type.

 

Gumbo: Flex Builder debugger support added

E-mail Print PDF

Felx Builder debugger support has been added to the sources of the Adobe Flex SDK. Just update your working copy or download the latest Nightly Build and you can start debugging your Gumbo applications in Flex Builder! Gone the days of adding the trace command everywhere in your code and analyzing a bloated flashlog.txt file. Don't forget to install the Flash Player 10 plugin or ActiveX control for your browser from the directory in\player\10\<platform>.

Related Article: Gumbo: Development Environment Setup For Flex Builder.

 

Gumbo: Inline Two-Way Data Binding

E-mail Print PDF

Recently, a new mechanism of defining two-way data binding has been added to the Gumbo sources. It makes creating such bindings easier and it offers two ways to do it:

  1. Using the "@{expr}" binding syntax
  2. Setting the new property "twoWay" of the "" tag to "true"

Here is an example to show both methods:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
  3.    
  4.     <mx:Script>
  5.        <![CDATA[
  6.            private static const LOREM:String = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque a nunc nec elit vulputate hendrerit. Sed adipiscing. Proin non metus in odio imperdiet ultricies. Vivamus vestibulum purus sit amet sapien. Quisque sollicitudin. Phasellus vitae elit. Donec sodales, nisl eu adipiscing convallis, felis nisl ullamcorper arcu, in lobortis pede mi ac erat. Praesent in ipsum sed mi vulputate bibendum. Donec malesuada. Quisque lobortis. Vestibulum sit amet augue et ligula interdum dignissim. Maecenas vehicula elit bibendum ipsum.";
  7.          
  8.            [Bindable]
  9.            private var txt:String;
  10.        ]]>
  11.    </mx:Script>
  12.    
  13.     <mx:Binding source="txt" destination="ta2.text" twoWay="true" />
  14.    
  15.     <mx:HBox>
  16.         <mx:TextArea id="ta1" height="150" text="{LOREM}" verticalScrollPosition="@{ta2.verticalScrollPosition}"/>
  17.         <mx:TextArea id="ta2" height="150" />
  18.     </mx:HBox>
  19.     <mx:Button label="Set Text" click="txt = LOREM" />
  20.     <mx:Text width="400" text="{txt}" />
  21.  
  22. </mx:Application>

You need Flash Player 10 to view the application:

flash_symbol

To test it click on the "Set Text" button and start dragging both scrollbars and editing the text of the second TextArea.

Here I use the first method to bind the positions of the vertical scrollbars of both TextAreas. No matter which scrollbar you move, the other will follow.

The second method is used to bind the text of the second TextArea with the bindable property "txt". To view its value, it was also bound (one-way) to the Text control.

 

Adobe AIR for Linux Beta

E-mail Print PDF

Adobe annouced yesterday the realease of the first beta of AIR for Linux in Adobe Labs. This is "a nearly feature complete" version as stated in the official annoucement. According to this annoucement also, the only missing major feature is the badge installer.

I tested this release on Ubuntu 8.04 even though according to the release notes, the officially supported version is 7.10. Guess what? It worked flawlessly! There is one strange thing thow: The annoucement and the Adobe AIR for Linux page state that this is version 1.1, while the installation directory on my system is "/opt/Adobe AIR/Versions/1.0". Is it 1.1 or 1.0?

 


Page 2 of 3

Shared Items