Made a post at Flex India Community !

March 31, 2008

Few days ago i made a post at the group Flex India Community and the Topic was
Effect on Flex and Flex Oppurtunities as IT industry is BAD“, just wanted to know some info regarding this, And to mention there is only one reply to
the post and it was from “Anish kumar” [member of the community]and he educated me on that.

I would like to share the reply he made, with you people and i guess there are some people wanting to know.

The reply is
The IT industry in general is slowing down because of recession, but I
dont see the opportunities for Flex slowing down. I can only see it
growing with each day. Flex (along with AIR) has opened a new world of
possibility and it will be very hard to slow down atleast for now. The
current recession will not have a adverse impact on Flex opportunities
in India as long as you are strong in that technology.

Good one though !.

Error Messages are Tracable From Flash Error Window !

March 28, 2008

The Errors in the Flex Page,[mxml] are Tracable, this means that the errors occurring  in the  flex page  can be found easily, the error message in the Flash Error Window contains the Line number with it, so the error at particular line can be traced out and with this the error’s are easily solvable.

This is know to many flex developers around the Globe but why writing this Post, the reason is that the people i am working with doesn’t know this thing and they are wasting their time with imaginary errors, the errors [runtime] are not coming from outer space or they are not UFOs around the monito, they are caused by misunderstanding of the definitions in the Language , everyone does it but correcting them and preventing them happening again is IMP.

The below Image contains the line numbers of the Flex page errors marked with RED.

Flash Error Window.

Enjoy Flexing .

How to Create a Lib(.swc) File ?

March 27, 2008

The .swc file is the component compilation of the components.With this file included in the other projects of the lib folder [using Flex Builder IDE] we can use those compiled components.After include it in the lib foler of the project ,the components are added to the Custom folder in the Components view.
To do this we need to create a Library Project in Flex Builder, and create components there with our properties and functionality and the relating .swc file is created in the bin folder in that project which is the compilation of the components we define in the Library Project,we can define and create as many components in the Lib Project and the corresponding .swc file is updated i.e the compilation of the components are written in it.

So, when your are done with defining the components in Lib Project add the .swc file in the lib folder of the required Flex Project where you would like to use this custom components.

Now drag the CustomComponents from the Custom folder in the components view on the design view and the required functionality is written in them and we can add other funtionality.

This is with the Flex Builder, if not using the Builder then define the components in a folder and compile the components in that folder it will generate the .swc file.

For compilation use the command promt with the commands like

mxmlc filename.mxml

Happy Flexing..

Path of the SharedObject File at the client System.

March 21, 2008

The ApplicationData Folder in the “c:/doc and sett/username/” location is hidden, so remove that option to view that file and the complete file location is here.

C:Documents and SettingskumarApplication DataMacromediaFlash Player#SharedObjectsNLUAAU2Z#localhostflex3projectsExamples1bin-debugBlogAggregator.swf

In this location the files are present with .sol type.

comments are welcome.

Cookies and Sessions in Flex.

March 20, 2008

My previous post tells about creating SharedObjects for simple cookies using the method getLocal(), but for something similar to that sessions we have to use the getRemote() method.
The syntax is similar to that of getLocal() method, for creating file,and adding name and values for it.

They are passed in between the client and server for access.Similar functionality as that of
the Sessions as normal.

But there is one limitaton in using this method getRemote(),that they can only be interacted
with Adobe Flash Media Server.

Using SharedObjects for Cookies in Flex.

March 17, 2008

I can say that SharedObjects are the Full extension for normal Browser cookies, because it has features that are not in normal browser cookies.
The Basic meaning is same “They are used for storing client data on the client Harddisk”.And access them through out the site when live or access them on next visit.

As the Syntax differs:

public var mySO:SharedObject;
mySO = SharedObject.getLocal(“mydata”);

here mydata is the file used to store the user data on the client machine and they reside at
a particular path that is hidden.[ see Flex help file for Path]

The SharedObject class has some methods in it for storing user data.

getLocal() -> creates the file or copies the reference of the file if created.

and to store data.”TodayDate”;

As i said its “Full extension for normal Browser cookies”,its meaning is it can store data
of Three DataTypes– Date,String,Array.


flush() —> its used for writing the values in to the file.And the SharedObject files are
Stored in the .sol format.


clear() –> delete the file.[.sol]

Explore the Class.

NativeWindow Class in AIR.

March 13, 2008

AS i started learning AIR i will make posts in it and guess what found a class in AIR to minimize ,maximize and closing your Windows.

code example:

private var appWindow:NativeWindow;


similarly there are other methods in it “explore”  them. and iam doing that.

Enjoy the code.

A Simple AIR App by me.

March 13, 2008

I have done a simple AIR App which displays the search results for the entered text from google search engine.

It contains a text input which takes the search text and a Html control which displays the
search results in it.
Download it here and check it out and leave comments.

search screen.

using the trace() method.

March 12, 2008

After all these days working with Flex Builder i never used the trace() method and to tell the truth i didn’t even look at this statement before, like what it does and what it really means.And when i found the usage of this statement i really felt bad for my ignorance,as my boss always says “kumar iam not happy with your ignorance”,hope this line doesn’t hurt anyonce’s feelings.

The trace() method is very usefull when debugging your App, it gives out the clear trace of the
statements in your App and keep track of values in the App while debugging.The output can be observed in the output window [ Console Window ],the values or statements we trace.

Example statements:

private var dtf:Date;
dtf=new Date();

Now debug the App and observe the results in the condole Window.

similarly another statement,

var i:int;

like wise we can use the trace() method, its a simple statement but veryusefull.console window.

console window is shown above.Enjoy the code.


Read comment #2 below for more on the topic.

defaultButton property in HBox control of Flex.

March 8, 2008

I found out one property that was actually hidden in the Control of HBox, i had a requirement and when i searched for that i found that hidden one.

And its really very use full in using that property and the functionality of defaultButton is know i think[ One reading this post] .

code example:

<mx:HBox defaultButton=”{btn}” >
<mx:Button id=”btn” label=”One”/>
<mx:Button id=”btnbtn” label=”Two”/>
<mx:Button id=”btnbtn” label=”Three”/>

This property will also be defined in the other Alingment Tags.Enjoy the code.

prompt in ComboBox control in Flex.

March 7, 2008

When we are working on ComboBox control in Flex we give a default value to it so that the user using the Control is Prompted with some message. The default value like “select a product” …. something like that for the user Interface to select a value from the list. So to set this we can use a existing property in the ComboBox control called “prompt”.Example is given below.

<mx:ComboBox x=”89″ y=”299″ width=”240″ prompt=”Select Product..” labelField=”@PRO”  dataProvider=”{arrColl}”  id=”cmbStatus” ></mx:ComboBox> 

As you can see the property usage in the control and the dataProvider is the ArrayCollection [An Example].

Enjoy the new Property in ComboBox control. And Enjoy the code.

prompt property in ComboBox control in Flex.

This image shows the property.


Get every new post delivered to your Inbox.