Friday, May 29, 2009

Tooltips

hi friends


Today am learned about tooltips......

Validation and error messages

hi

Today am learned about validators like…

*Changing the color of the validation error message

*Clearing a validation error

* Specifying a listener for validation

*Validating ZIP codes

*Validating strings

*Validating social security numbers

*Validating phone numbers

Wednesday, May 27, 2009

Working with validation events

Listen for validation events dispatched by the component being validated.
Flex components dispatch valid and invalid events, depending on the results of the validation and perform any additional processing on the component based on its validation result.
The event object passed to the event listener is of type Event.

Listen for validation events dispatched by validators.
All validators dispatch valid or invalid events, depending on the results of the validation. Then perform any additional processing as required by your validator.

The event object passed to the event listener is of type ValidationResultEvent.
*Explicitly handling component validation events
*Explicitly handling validators validationevents

Tuesday, May 26, 2009

Validating Data

Hi..
when we using the Flex validators do not eliminate the need to perform data validation on the server, but provide a mechanism for improving performance by performing some data validation on the client side.when the user enter the data in the UIcontrols it should have some rules to the application.

we write codes in two ways
* MXML.
* ActionScrpit.

In MXML I created one simple to validate the phone number.
Code
mx:PhoneNumberValidator
id="pnV"
source="{phoneInput}"
property="text"
mx:TextInput id="phoneInput"

In above sample phone number validator is used to validate the phone number.
Text input box is used to enter the data,and the data should be less than 10 digit number.Else,it shows error in red color around the box.

Friday, May 22, 2009

Create a circle by using the actionscripit

Hi

Today learned about how to draw a circle or line in mxml.Normally in flex there no circle component ,if we like to create a circle there is no such components in mxml.
By using action I am draw one circle by using actionscript.

It is the example to create a circle with color.....
within the scripit u code like this
import mx.controls.Alert;
import mx.core.UIComponent;
public function circle():void
{
var newcircle:Sprite=new Sprite();
newcircle.graphics.beginFill(0x000000,1);
newcircle.graphics.drawCircle(10,10,8);
newcircle.graphics.endFill();
var d:UIComponent=new UIComponent();
this.addChild(d);
d.addChild(newcircle);
}
*import the flash.
*Create the object as newcircle.
*Begin to draw a circle.
*Draw the with xposition 10,y position10,and then Draw with radius 8.
*create a variable to get the circle as component.
*By using addchild the object.

Monday, May 18, 2009

Validation Error

Hi . .

Today am learned something about the Validation error .It is used to display the error messages.You can customize the look of the component and the error message associated with the error...
* If a validation error occurs, by default Flex draws a red box around the component associated with the failure.
* If the user moves the mouse pointer over the component, Flex displays the error message associated with the error.
Working with Validation Error
Subclasses of the UIComponent base class, which include the Flex user-interface components, generally handle validation failures by changing their border color and displaying an error message. When validation succeeds, components hide any existing validation error message and remove any border.

Sample code
mx:PhoneNumberValidator
id="pnV"
source="{phoneInput}"
property="text"
wrongLengthError="Please enter a 10-digit number."/> mx:TextInput id="phoneInput"
mx:TextInput id="zipCodeInput"
In the above code,I am used the controls like Textinput,to get the string.PhoneNumberValidator is used for validate the entered data in textinput.If wrongly enter the dight means it displays the error,which is given in the wronglength error.

Thursday, May 14, 2009

Using data binding to configure validators

You configure validators to match your application requirements.
E.g.., For a String to be considered valid, it must be at least the minimum number of characters long, and less than or equal to the maximum number of characters.
Often, you set validator properties statically, which means that they do not change as your application executes.
E.g.., StringValidator defines that the input string must be at least one character long and no longer than 10 characters

Enablind and diabling a validator

Value of the enabled property is true, the validator is enabled;
when the value is false, the validator is disabled.
When a validator is disabled, it dispatches no events, and the validate() method returns null.
E.g: Validator.enabled

Friday, May 8, 2009

Layout Container

A Box container lays out its children in a single vertical column or a single horizontal row. The direction property determines whether to use vertical (default) or horizontal layout.
The Box class is the base class for the VBox and HBox classes. You use the mx:Box, mx:VBox, and mx:HBox tags to define Box containers.
Properties :
Direction=Horizontal |Vertical
*The direction in which this Box container lays out its children. MXML values are "horizontal" and "vertical". Possible values in ActionScript are *BoxDirection.HORIZONTAL and BoxDirection.VERTICAL.
The default value is BoxDirection.VERTICAL

Thursday, May 7, 2009

Setting the size of a media component

The appearance of any video media playing in a VideoDisplay control is affected by the following properties…
MaintainAspectRatio
Height
Width
MaintainAspectRatio property is false, the size of the playing media determines the value of the other property.
MaintainAspectRatio property is true, the media retains its aspect ratio when resizing.

About the Video Display control

Video Display control with no visible user interface. It is simply a control to hold and play media.
Video Display control also supports the volume property. This property takes a value from 0.0 to 1.00.

Mute 0.0
Maximum Volume 1.00
Default Value 0.75
Using methods of the VideoDisplay control
close().
load().
pause().
play().
stop().

Using media in Flex

Media, such as movie and audio clips, are used more and more to provide information to web users.
*Showing a video message.
*Streaming movies or movie previews.
*Streaming songs or song snippets .
*Providing learning material in the form of media.

VideoDisplay

Flex supports the Video Display control to incorporate streaming media into Flex applications. Flex supports the Flash Video File (FLV) file format with this control.

The Video Display control does not support scan forward and scan backward functionality.
Video Display control does not support accessibility or styles.
User cannot see anything unless some video media is playing.

Wednesday, May 6, 2009

RadioButtonControl

Creating a RadioButton control
Radio Button control is a single choice in a set of mutually exclusive choices. A RadioButton group is composed of two or more RadioButton controls with the same group name. Only one member of the group can be selected at any given time.
RadioButton User Interaction
* RadioButton control is enabled, when the user moves the mouse pointer over an unselected RadioButton control, the button displays its rollover appearance.
* RadioButton control is not enabled, the RadioButton control and RadioButton group display the disabled appearance, regardless of user interaction.
In the disabled state, all mouse or keyboard interaction is ignored.

THANK YOU …

Tuesday, May 5, 2009

data driven controls

Several controls take input from a data provider, an object that contains data. For example, a Tree control reads data from a data provider to define the structure of the tree and any associated data assigned to each tree node.

Several of the controls that use a data provider let you visualize complex data, and there are different ways to populate these controls by using a data provider. The following topics also provide information on data providers and controls that use data providers:

Using Data Providers and Collections contains details on data providers and how to use collections as data providers.
Using Menu-Based Controls contains information on using Menu, MenuBar, and PopUpMenuButton controls.
Using the AdvancedDataGrid Control contains information on using the AdvancedDataGrid control, which expands on the functionality of the standard DataGrid control to add data visualization features to your Adobe Flex application.
Creating OLAP Data Grids contains information on using the OLAPDataGrid control, which lets you aggregate large amounts of data for easy display and interpretation.

Monday, May 4, 2009

Creating Item Renderer

Flex define item renderers and item editors in three different ways:

Drop-in item renderers and item editors
Insert a single component to define an item renderer or item editor.
* Using a drop-in item renderer or item editor.


Inline item renderers and item editors
Define one or more components using child tags of the list control to define an item renderer or item editor.
* Using an inline item renderer or item editor.


Item renderer and item editor components

Define an item renderer or item editor as a reusable component.
* Using a component as an item renderer or item editor.

Thursday, April 30, 2009

How to delete the cells in datagrid

hi friends...

I learned about the datagrid,how to delete particular cells.The contents are removed in the datagrid by using RemoveItemAt() comment..when we delete a single row means,by using this command...If we want to delete 'n' Number of row means first we get the data using the command getItemAt()..then remove by RemoveItemAt() .....

Wednesday, April 29, 2009

To change particular color in a row

Hi friends,

In the datagrid i did some tasks...
*How to add the component in the datagrid
*How to give the effects the datagrid
*How to change the color the particular row

First use the concept of Itemrender ,it is used to insert component in the datagrid
Second one is giving the Iris(any effect) for the item renderer component
third is by clicking itemrender component(like Button) the color will changed

Tuesday, April 28, 2009

Effects in datagrid

hi Friends,

i am learned about the itemrender,how it is used in the datagrid.. Item Renderer is to used to some extra components suchas button,checkbox ,combobox etc ...

how it was added in the datagrid

Wednesday, April 15, 2009

Creating Flex Components

Not only does Flex have built-in support for properties and events, it includes a higher-level abstraction language (MXML) for laying out and configuring components, which greatly simplifies the development process. You can even create new components directly in MXML, although that's more commonly done using ActionScript. This article shows how to create components in Flex and how clean the resulting applications can be that use those components.

You'll see that ActionScript is quite similar to Java in many ways, but I hope you'll also see that ActionScript includes time-saving features that don't appear in Java.

Although you can write all your Flex code by hand and compile it using mxmlc (the free command-line compiler), it's much easier to use FlexBuilder which is built on top of Eclipse and has command completion, context help, built-in debugging and more. Some of the examples in this article use AIR, a beta feature that allows you to create desktop applications that access files and other aspects of your local machine (rather than being limited to the web sandbox).