The following example shows how you can prevent or allow negative numbers when using the NumberValidator class by setting the Boolean allowNegative property.
Full code after the jump.
Continue reading ‘Validating negative numbers using the NumberValidator in Flex’
The following example shows how you can validate a number as an integer or real (floating point) number by setting the domain property on a NumberValidator instance.
Full code after the jump.
Continue reading ‘Validating integers using the NumberValidator class’
The following example shows you how you can validate email addresses in a Flex application using the EmailValidator class and the validate() and static EmailValidator.validateEmail() methods.
Full code after the jump.
Continue reading ‘Validating email addresses using the EmailValidator class in Flex’
The following example shows how you can create a new Flex component instance by using its class name by calling the getDefintionByName() method.
Full code after the jump.
Continue reading ‘Creating a component instance by class name in ActionScript 3.0′
The following example shows how you can parse an XML node with a dash in its node name (<font-family />) as well as parsing an Object with a dash in it’s identifier using the square bracket notation ([]).
Full code after the jump.
Continue reading ‘Parsing XML nodes and Objects with dashes in their names in ActionScript 3.0′
The following example shows how you can specify a background image for a Flex VideoDisplay control by setting the backgroundImage style.
Full code after the jump.
Continue reading ‘Setting a background image on a VideoDisplay control in Flex’
The following example shows how you can set the horizontal scrollbar policy on a Flex DataGrid control by setting the horizontalScrollPolicy property to one of the constants in the mx.core.ScrollPolicy class.
Full code after the jump.
Continue reading ‘Setting the horizontal scrollbar policy on a DataGrid control in Flex’
The following example shows how you can set the vertical scrollbar policy on a Flex TextArea control by setting the verticalScrollPolicy property to one of the constants in the mx.core.ScrollPolicy class.
Full code after the jump.
Continue reading ‘Setting the vertical scrollbar policy on a TextArea control in Flex’
The following example shows how you can scroll a Flex TextArea control by setting the verticalScrollPosition and maxVerticalScrollPosition properties.
Full code after the jump.
Continue reading ‘Programmatically scrolling a TextArea control in Flex’
The following example shows how you can browse for an image file from your local file system and preview the image before uploading it to a remote webserver by using the FileReference class’s new load() method in Flash Player 10. Once the user has browsed and selected an image from their local machine, you can call the load() method which dispatches a complete event when the image has successfully loaded, at which point you can display the image using a Flex Image control and setting the Image instance’s source property to the FileReference class’s data property (which is a ByteArray).
Full code after the jump.
Continue reading ‘Previewing an image before uploading it using the FileReference class in Flash Player 10′
The following example shows how you can use the FileReference class’s new save() method in Flash Player 10 to save text, XML, and image files to a user’s hard drive.
Full code after the jump.
Continue reading ‘Saving files locally using the FileReference class’s save() method in Flash Player 10′
The following example shows how you can define a FileReference object in MXML by defining a custom namespace for the flash.net package.
Full code after the jump.
Continue reading ‘Creating a FileReference object using MXML in Flex’
In a previous example, Setting the background color of the RichTextEditor text area in Flex, we saw how you could set the background color of the RichTextEditor control’s nested TextArea control by setting the backgroundColor style.
The following example shows how you can set the background alpha of the Flex RichTextEditor control’s nested TextArea control by setting the backgroundAlpha style.
Full code after the jump.
Continue reading ‘Setting the background alpha of the RichTextEditor text area in Flex’