Installing Adobe Flex builder in Linux

After a mess up commands,i have got a solution from my friend who fix the Adobe Flex Builder in Linux(Much more easier way).

Step 1:
Download Eclipse3.3.

Step 2:

Download AdobeFlexBuilder.

Step 3:

Create a new directory in /home/username/name of the directory.

Step 4:

Copy both the downloaded file to that directory.

Step 5:

Open up the ‘Terminal’.

Type the command to extract your eclipse.

$ sudo tar xf eclipse-java-europa-winter-linux-gtk.tar.gz

then start the Flex builder installer.

$ sh flexbuilder_linux_install_a4_081408.bin

Locate where you want to install the Flexbuilder and choose where you have your eclipse extracted.

Thats it..

It will be up and running…

Thanks .All credits go to my friend.

Advertisements

Simple Alert in Flex

Sample code to understand Alert in Flex.

Step 1:
Create a New Flex Project in a Flex Builder with Application type “None”.

Step 2:
Then MXML file will be opened and ready to start.

Go to Design View

Step 3:
Drag a Button from the Flex Component.

Step 4:
Change the label of the Button and add click event to the button using the function name.

Sample code looks like

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml&#8221; layout=”absolute”>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function show():void
{
Alert.show(“You have clicked the Button”,”Message Window”);
}
]]>
</mx:Script>
<mx:Button x=”271″ y=”84″ label=”Click Me” click=”show()”/>
</mx:Application>

Step 5:
Thats it all done.

Output looks

Calling a Javascript in Flex

Steps to call a javascript from Flex.

Step 1:
Create a New Flex Project in a Flex Builder with Application type “None”.

Step 2:
Then MXML file will be opened and ready to start.

Go to Design View

Step 3:
Drag a Button from the Flex Component.

Step 4:
Change the label of the Button and add click event to the button using the function name.

Step 5:
Add a simple script in Flex code View.

For Calling a Javascript in Flex, we have to use ExternalInterface.

Call refers to calling a javascript and hello is nothing but the function name in the javascript.

Code looks like this,

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml&#8221; layout=”absolute”>
<mx:Script>
<![CDATA[
private function show():void
{
ExternalInterface.call(“hello”);
}
]]>
</mx:Script>
<mx:Button x=”271″ y=”89″ label=”Click Me” click=”show()”/>
</mx:Application>

Step 6:
Now,here is the actual problem arise.

Where to put the javascript code.

But its quite simple,here it is.

In your Flex Project,you have a directory called “html-template”.

In that you will have “index.template.html”.

In that file,before the closing of head tag you have to place your Javascript code.

Sample JavaScript code

function hello()
{
alert(“Call from Javascript”);
}

Thats it all done.

Output