A Tip on Alert Control in Flex

July 24, 2009

Question:

How to disable selectivity on Alert control display message?

(or)

Alert control display message should not be selectable.

Solution:

var alert:Alert=Alert.show(“Cannot select this text!!!”);
alert.mx_internal::alertForm.mx_internal::textField.selectable=false;

Enjoy the post.

Advertisements

A Tip on Alert Control in Flex.

July 20, 2009

Question:

How to make the defaultButton on Alert Control invisible?

Solution:

var a:Alert;
a = Alert.show(“where’s my defaultButton (OK)!”);
a.mx_internal::alertForm.mx_internal::defaultButton.visible = false;

Enjoy the Post.


A Tip on Panel Control in Flex.

June 8, 2009

Ok here is the Question to me, How to display html text for the title text of the Panel ?.

Solution:

var tfTitle:IUITextField=panel.mx_internal::getTitleTextField();
tfTitle.htmlText=”This is <B><FONT COLOR=’#FF0000′>Panel Title</FONT></B>”;

Here panel is the id of the Panel Control used. Enjoy the post.


A Tip on using XML Class methods on XMLList Objects.

May 14, 2009

For using the XML Class methods with an XMLList Object containing one or more XML Objects you have to iterate through the XMLList Collection and apply the XML Class methods to each XML Object in the Collection.

For example use the for each.. in statement to iterate through the XMLList Collection and access the individual XML Objects and apply the required XML Class methods to the individual XML Objects.

Example:

Suppose i have an XMLList Like below

<firstwife>

<name>Aish</name>

<age>35</age>

<dob>12/10/1974</dob>

</firstwife>

<secoundwife>

<name>Anu</name>

<age>25</age>

<dob>10/12/1984</dob>

</secoundwife>

then i would iterate this XMLList like below,

for each(var xml:XML in resultXMLList)

{

trace(“ ”+xml);//now apply XML Class methods to this XML Object.

}

[Here resultXMLList is my XMLList]

Observe the output now,it will print out the individual XML’s.Enjoy the post.


A Tip on Date Class in Flex.

March 26, 2009

When you come across a Class and explore it, you should be really concentrating on the very basics of that Class first.So here I am talking about the Date Class.You can create Date Objects in four different ways.So explore about that, then you should be able to answer this question How to find the number of days betweeen two Date’s in Flex ?

Solution:

private const MS_PER_DAY:uint = 1000 * 60 * 60 * 24;

var strd1:Date=new Date(2009,2,18);
var strd2:Date=new Date(2009,2+1,18);
var tempDate:Date = new Date(strd2.time – strd1.time);

trace(‘No. of Days:’+tempDate.time/MS_PER_DAY);

Enjoy the post.


Multiple Selected Items in a Tree Control in Flex.

February 14, 2009

To Access the multiple selected items in a Tree control we got to enable the multiple selection in the Tree control like below.

allowMultipleSelection=”true”

Then we can access the selectedItems of the Tree control with the property “selectedItems” like below code.

for(var i:int=0;i<tree.selectedItems.length;i++)
{
trace(tree.selectedItems[i].@NAME);
}

Here tree is the id of the Tree control and NAME is the attribute name of the dataProvider of the Tree control.Check the code for clearance.

Run Demo App.

Download Code Example.


Basic info about “degrafa”.[pdf download]

November 6, 2008

If you can atleast go through this pdf file about degrafa Frameworks.Then you will know that they rock.

Download pdf