Tag Archive for 'flex-examples'



03
Dec

Flex Using the String Validator

The StringValidator class validates that a string length is within a specified range. The following example ensures that a string is between 6 and 12 characters long:

Code Samples:

<?xml version="1.0"?>
<!-- validators\StringExample.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Form id="membershipForm">
<mx:FormItem id="fullNameItem" label="Full Name">
<!-- Not validated -->
<mx:TextInput id="fullNameInput"/>
</mx:FormItem>
<mx:FormItem id="userNameItem" label="Username">
<mx:TextInput id="userNameInput"/>
</mx:FormItem>
</mx:Form>

<mx:StringValidator source="{userNameInput}" property="text"
minLength="6" maxLength="12"/>
</mx:Application>
03
Dec

Flex Using external style sheets

Flex supports external CSS style sheets. You can declare the location of a local style sheet or use the external style sheet to define the styles that all applications use. To apply a style sheet to the current document and its child documents, use the source property of the <mx:Style> tag.

NOTE You should try to limit the number of style sheets used in an application, and set the style sheet only at the top-level document in the application (the document that contains the <mx:Application> tag). If you set a style sheet in a child document, unexpected results can occur.

The following example points to the style.css file in the flex_app_root/assets directory:

<?xml version="1.0"?>
<!-- styles/ExternalCSSExample.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Style source="../assets/style.css"/>

<mx:Button id="myButton" label="Click Here"/>
</mx:Application>
 Continue reading 'Flex Using external style sheets'
03
Dec

Flex Zoom Effect

The Zoom effect zooms the object in or out on a center point.

When you apply a Zoom effect to text rendered using a system font, Flex scales the text between whole point sizes. While you do not have to use embedded fonts when you apply a Zoom effect to text, the Zoom will appear smoother when you apply it to embedded fonts.

Note: The Zoom effect does not work when the Container.autoLayout property is false.

The <mx:Zoom> tag inherits all of the tag attributes of its superclass, and adds the following tag attributes:

Code Samples:

  <mx:Zoom    id="ID"    captureRollEvents="false|true"
originX="Calculated"    originY="Calculated"    zoomWidthFrom="0.01"
zoomWidthTo="1.0"    zoomHeightFrom="0.01"    zoomHeightTo="1.0"  />

03
Dec

Flex WipeLeft Effect

The WipeLeft class defines a bar wipe left effect. The before or after state of the component must be invisible.

You often use this effect with the showEffect and hideEffect triggers. The showEffect trigger occurs when a component becomes visible by changing its visible property from false to true. The hideEffect trigger occurs when the component becomes invisible by changing its visible property from true to false.

Continue reading ‘Flex WipeLeft Effect’

03
Dec

Flex SoundEffect

The SoundEffect class plays an MP3 audio file. For example, you could play a sound when a user clicks a Button control. This effect lets you repeat the sound, select the source file, and control the volume and pan.

You specify the MP3 file using the source property. If you have already embedded the MP3 file, using the Embed keyword, you can pass the Class object of the MP3 file to the source property. Otherwise, specify the full URL to the MP3 file.

The <mx:SoundEffect> tag inherits all of the tag attributes of its superclass, and adds the following tag attributes:

Continue reading ‘Flex SoundEffect’



Get Adobe Flash playerPlugin by wpburn.com wordpress themes