Sunday, May 2, 2010

Dynamically change height of TileList

You have to adjust rowCount of Tile List to make height according to data at runtime. In below example if column count is 1 you rowCount="data.length()". Now data can be XML children.length() or array.length or any data length.

[mx:TileList id="_videoList" rowCount="{data.length()}" updateComplete="changeHeight"]

You can also updateComplete if you have column count more than 1.

private function chanegHeight():void{
var rc:int = Math.ceil(data.length() / _videoList.columnCount);
if (_videoList.rowCount!=rc) _videoList.rowCount = rc;
}

Cheers,
Nehul

Thursday, April 29, 2010

Auto justify text use mx:Text

If you want auto justify for text in

[mx:Label truncateToFit="true" text="xyzx"]

use [mx:Text]

line break in text="hello\nworld"

Monday, March 29, 2010

XML error while connecting Flex 4 to Java using BlazeDS 4 in Flash Builder

You might face of the following error while creating data service using BlazeDS.

=========================
ERROR: XML parse error: Error on line 1 of document: cvc-elt.1: Can not find the declaration of element ‘model’. Nested exception: Can not find the declaration of element ‘model’.
=========================

In that case make sure you download latest BlazeDS 4 nightly build. Once you unzip the file you will get war file. Just dump that with different name under Tomcat/weapps directory. You have to copy files from lib directory into existing application webapps//WEB-INF/lib directory.

Building Flex 4 application for BlazeDS 4 Remoting destinations using Flash Builder 4

Everybody knows Flex 4 has great features like connecting to different backend using BlazeDS or PHP, ColdFusion, LCDS or HTTPService/Web Service.

Now you can create Flex 4 UI without doing single line of code. First you have to get the following software

1. Flash Builder 4
2. BlazeDS 4 or nightly build is fine
3. MySQL server
4. Create schema and table.
5. Create Java Class to get data from MySQL. Also create public method with return type as List(Object) so you can bind them to Flex DataGrid easily.
6. JDK 1.6 installed.
7. Tomcat 6 installed.

Please note you will have more complex things to do in real life so just take above as exercise.

1. Create Flex Project in Flash Builder and select J2EE as backend and select BlazeDS.

2. Setting BlazeDS 4.
After you copy your blazeDS.war into tomcat/webapps directory go to webapps//web.xml and make changes to RDSServlet part as following

{param-value}false{/param-value}

3. You have to set your destination in tomcat/webapps//flex/remote-config.xml

Please make sure you have Java class name in tomcat/webapps//WEB-INF/classes directory.

4. Select "Data" --> "BlazeDS" from Menu option of Flash Builder. In new window it will show you destination name i.e. {servicename} from step 3. Click on checkbox next to it and click on "Finish" button.


5. After that drag DataGrid component in Flex Project using Component view. Still in Component view right click on DataGrid and select "Binding Data" option. It will prompt you to select service and method name. If you have more than one method select one you want more combobox.

After that everything is done by Flash Builder.

RUN You application to see data populated in datagrid without single line of coding in Flex 4.

You can also create free form i.e. (mx:Form) for the same method call on destination. If you have method call findAll() for users or anything else it will create form with option to hand pick required field for edit, update or delete operation.


Enjoy,
Nehul

Thursday, March 11, 2010

Migrating from Flex 3 to Flex 4

One of the simple trick and very important one is to add following line in Flex compiler. Right click on Flex project name from Flex 4 & select "Properties" option (last one). In open window click on "Flex Compiler" and following line at the end.

-compatibility-version=3.0

After that compile your application and you can see Flex 3 apps migrated or compiled in Flex 4.

If you have CSS issues at this line in your Flex code.



@namespace "http://www.adobe.com/2006/mxml";



PS: Adobe is going to release Flex 4 sometime end of March 2010 or April 2010, so it almost about the time you should to start thinking of converting your existing Flex 3 apps into Flex 4.

Flex 4 has simplified State declaration and make it very easy to implement. I think it is worth the efforts to convert even if your existing one works fine.
Cheers

Monday, January 25, 2010

Internet Secuiryt 2010 Virus removal solution

Two step or one up to you

1. Boot computer in safe mode (Press F8 while rebooting)

2. In safe mode you can remove sucker from "program files/Internet security 2010" folder.

3. Now install Malwarebytes from http://www.malwarebytes.org/, which will remove this junk virus right away and you free.

I ask you to do safe mode if virus doesn't allow you to install any software.


Manual Remove or verification that virus is removed.
===================
Internet Security 2010 manual removal:
Kill processes:
IS2010.exe 41.exe winlogon86.exe winupdate86.exe

Delete registry values:
HKEY_CURRENT_USER\Software\IS2010
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run "Internet Security 2010"
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run "winupdate86.exe"

Unregister DLLs:
winhelper86.dll

Delete files:
IS2010.exe 41.exe winhelper86.dll winlogon86.exe winupdate86.exe Internet Security 2010.lnk

Delete directories:
C:\s
C:\Program Files\InternetSecurity2010\
====================

Enjoy

Thursday, January 21, 2010

How to apply for greencard for visting parents as a US citizen

NOTE: NO PERSONAL COMMUNICATION. PLEASE POST YOUR QUESTIONS ON BLOG.

I-693 (after 90 days of stay of parents in US)

Got both Medical Examination by a INS approved doctor in the vicinity.

==================
I-130 (1 application form for each parent & 1 copy of all the documents - hence total of 2 applications + docs)

Copy of Parent Birth Certificate
Copy of Parent Marriage Certificate
Fees for each parent ($355 right now going on)
Copy of My Naturalization/Citizen Certificate
Copy of Parent I-94 card - both sides
Copy of parent old or new passport (include all non blank pages)
Copy of My U.S. Passport

==================
I-485 (1 application form for each parent & 1 copy of all the documents - hence total of 2 applications + docs)

Check Latest Fees. Fees for each parent.
Copy of My Naturalization/Citizen Certificate.
Make sure you write the visa number correctly in the application form. It's on visitor visa stamp in passport.
2 Color photos of each parent write the name on the back with a pencil
Copy of My Passport
Copy of my Birth Certificate
Copy of Parent Birth Certificate
Copy of Parent Marriage Certificate
Copy of Parent I-94 card - both sides
Copy of Parent old & new passport with all non blank pages
Parent Medical Exam - I 693
G - 325,I - 130, I 864
Copy of siblings Green Card if you have any present in U.S.

==================
I-864 Affidavit of Support (1 application form for each parent & 1 copy of all the documents - hence total of 2 applications + docs)

Copy of I130
Copy of My Pay Stub for last 6 months
Copy of My Employment Certificate
Copy of My Birth Certificate
Copy of My Passport
Copy of My Naturalization/Citizen Certificate
Last Three years tax return (got to near by IRS office to get copy if you don't have)
Copy of last 2 years W2's
Copy of last 2 months bank statements
Copy of Assets - Copy of my 401K, Copy of My ETrade and Copy of My Home Equity Papers. It is optional to declare it if you are above poverty line as mention in form I-864P.
My wages are above the poverty line so I did not have to fill out family support documents.
There is no fee for this application :-)
==========================
I-131 OPTIONAL (Not required to file unless your parent want to travel outside US while I-485 is pending)

I-131 Advance Parole (1 application form for each parent & 1 copy of all the documents - hence total of 2 applications + docs)

I filed this with 485 application so No Fees :)
Letter for each parent as to why they need to leave the country on advance parole.
Copy of Parent I-94 card - both sides
Copy of parent old & new passport
2 Color photos of each parent - write the name on the back with a pencil
==========================

G-325 (1 application form for each parent hence total of 2 applications)

No Fee
No document need to be attached.

==================================

INTERVIEW QUESTIONS: (happen in 2010)

Relax they will only ask you question related to your case. Mostly name change, birth or marriage certificates translated but not very clear. They want to see the original that's it.. unless you are hiding something...

1. oath
2. show passport and citizen certificate
3. why you did not apply together -130 / 485 (applied separately not knowing we can do it together..no problem here)
4. original birth certificate
5. name change supporting documents
6. explain in India most of the time name is different during naming ceremony but change to real name and it is consistent till date.
7. I-94 taken
8. did you help someone to enter illegal in US - NO
9. fraudulent = illegal - NO
10. show birth certificate of petitioner
11. how many children
12. birth date of petitioner

==========================================

END RESULT: Green Card application approved.

Special Thanks to Alok Patel's original blog.

============================================

Path to Citizenship:

Simple process if you are applying after staying in US for 5 years on green card (please check if you are eligible on USCIS website)

1. Form N-400

2. Filing fee check in the amount of $680.

3. Two passport photos.

4. Copies of applicant's Permanent Resident card.

After you send your application to USCIS

1. They call for fingerprinting.

2. Interview in person.

3. Oath ceremony

You are done with citizenship process.

==============================================



ABOVE INFORMATION IS TO HELP OTHERS. I AM NOT LAWYER OR TAKING ANY RESPONSIBILITY OF ADVICE POSTED.