Thursday, July 22, 2010

Show Effect on TitleWindow

I recently found an interesting fact about the show effect on Titlewindow and that is that the effects should be defined in the main mxml that is calling the title window, and cannot be placed the title window mxml (assuming that you have separate mxmls for main and title windows).

for eg:
Main.mxml, is trying to display a title window in the mxml TtlWindow.mxml.
the show effect (myEffect) that is defined in TtlWindow.mxml (showEffect="myEffect"), should be declared in Main.mxml and not TtlWindow.mxml.

If you declare the effect in TtlWindow.xml the effect will not take effect.

Hope this will help someone ....
Please let me know your thoughts.

Saturday, June 26, 2010

Flex Debug Console on Broswer

Have you ever had to debug a flex app that was deployed on the server??? It is a pain is it not?? especially when you cannot reproduce the issue on your local development environment.

I know the pain... i have been through that situation recently...
And i also found a tool that makes this kind of debugging much much easier...

The Tool is "Flash-console" by google.

This tool has helped me a lot.. and i would ask every serious FLEX/Action Script developer to check it out...

I am still exploring all the possibilities and will update here if i find anything interesting...

Happy Coding.. !!!!!!!!!!!!! :-)

Wednesday, June 23, 2010

FLEX / Action Script XML Datatype Initialize issues.

I recently found an issue with XML DataType in Flex / Action Script ( 4 / 3 respectively).
I was trying to re-Initialize an XML variable using another XML variable as follow.


public var newTreeData:XML = ;
public var newTreeDataReset:XML = ;

......(***Changes 1) Do some changes to "newTreeData" ..............

newTreeData = newTreeDataReset;

......(***Changes 2) Do some more changes to "newTreeData" ..............

After this, i was expecting that "newTreeData" will contain the changes made in the code "***Changes 2" and the variable "newTreeDataReset" will still contain the initial value .

But i was wrong to expect that.... the changes made in the code "***Changes 2" were applied to both "newTreeData" and "newTreeDataReset".

I know this should not happen from a programming language/OO programming point of view but this does happen.....
I don't know if this a bug or if it is the intended behavior.

Hope this helps some one understand why the xml variable act strangely some times.


Tuesday, June 22, 2010

Compiling Flex Applications

I am working on creating a build script for deployment of my flex application, and i was wondering how do i find out if a given mxml needs to be compiled?
Generally only the Application mxmls can be compiled, so identifying an application mxml from a bunch of mxmls needed to be done.

To accomplish this i wrote a java class to open all the mxml files and (treat them as normal xml files) create DOM objects for each mxml and check the root node of the DOM object. If the root node is
"mx:Application" or "s:Application", the mxml was supposed to be compiled.

This is another reminder that mxml files are first of all xml files.

I have completed creating the automated build script for compiling FLEX applications, if any one wants to know more about the build script, Please drop me a message and i will be happy to share the build script with you...

Hope this post helps people, save some time...

Friday, June 18, 2010

Advanced Data Grid - alternate row colors.

Recently i have been working to create a Flex theme and wanted to change the alternating row colors for a Advanced Data Grid.
It took some time for me to figure out the correct style that can be used to change these colors.

Hope some one will save some time with this post.

So here it is ..
The style that is used to define the alternating colors in a Advanced Data Grid is ...

mx|AdvancedDataGrid
{
alternating-item-colors: #E8FDD5, #FFFFFF;
}

Tuesday, June 15, 2010

Flex3 to Flex4 Conversion

Recently i have been doing some upgrade work converting flex 3 mxmls to flex 4.
Not all components/containers have to modified for this upgrade, and i discovered an easy way to find out if a component needs to be converted.
I don't know if many people know about it,but Here is what i discovered.

In the Flash builder (version 4 is called Flash builder version 3 was called Flex Builder), if you take your mouse over a component and wait for a sec, it shows you if the component needs to be changed or not, as shown in the image below.

Here my flex 3 mxml had a Hbox component,and when i move my mouse over the component i am being told that this component needs to be replaced with "BorderContainer" or "HGroup".





Hope this will be helpful for some who is just starting to convert there flex 3 screens to flex 4 screens.

Friday, June 11, 2010

Context Menu and the word "Select"

After an agonizing 2 hrs struggle i found out that you cannot use the "Select" as a custom context menu item.

I was trying to add a custom context menu item for a Tree component. So when i right click on the elements of the tree there is an extra (custom) context menu "select" that appears, so the user can "select" the right element in the tree.
But little did i know that the "select" select was cursed (at least in this instance it is...).

I know that some where in the documentation adobe might have written that the word select should not be used as a custom context menu item, but here is my question to people who made the word "Select" a forbidden word....... Can you tell me more appropriate word for a situation that i described above...

At least i thought that the word "select" fit perfectly...

I hope this post will help someone save some time ...