Change the default cursor in Flex with Actionscript code:

February 11, 2008

Here the Class we got to use is CusrsorManager and some methods in it.

The following example shows the custom cursor on a Flex App.

[Embed(source=”images/cursorME.gif”)]
public static const loaderCursor:Class;
var cursorId:int = CursorManager.setCursor(loaderCursor); 

The code will set the cursor ,to remove it use the line of code.

CursorManager.removeCursor(cursorId);

Thats it the default cursor is changed.

Advertisements

Default Style Applied to Flex App’s.

February 9, 2008

When we create a new Project in Flex Builder the Flex APP is applied with a Default style it looks greay.Now the Question is Where does this style comes from and where is this .css file present or what style is it.

The answer is the style applied to your Flex App is present in the Flex Builder installation Folder itself.

If you wanted to look at the style [ .css file ] look in the following path there is a Style file called ” defaults.css ” and that is the style applied to all the Flex APP’s.

C:Program FilesAdobeFlex Builder 2Flex SDK 2frameworksdefaults.css

Word of the Day “The more you explore the more your are intelligent”.

Iam writing this post because one of my team member asked “what’s the Application Background color” , it means that he/she missed some basics of FLEX.


“Beta Expired Error” :problem solved [ pictures ]

February 7, 2008

As i mentioned in the previous post we have to change the SDK’s and to do this download it from Adobe labs and paste it in the Adobe->Flex Builder->sdks-> folder the default name of the folder is enough to include, no need to change the folder names.

Now open your flex builder and open any project ,right click on the project select properties then you would get a screen like the below.

beta1.jpg

Select flex compiler and at the right hand you would fine “configure flex sdks“[marked in red] select it to include sdks.

Then the screen would be like the below.

add the sdks

Here click the add button[red marked] to add the sdks ..

beta3.jpg

Click browse button [red mark] to include those sdks which were pasted in flex builder -> sdks folder and they are include and after that check it and include those and they are included and error is expired.

Final screen to check the sdks..

error expired!

click apply[bottom red marke] button after checking up [red markd] including those new sdka.

Thats all the the problem is solved “The Error is finally expired” . And no need to install again Flex Builder.

Leave any comments for queries.


“Beta Expired Error” :Problem solved

February 6, 2008

Today strangely my Flex Builder showed an Error “Beta Expire Error“, i was really puzzled for that and i could not run my App, then i said to myself  “what the F@#$K” and  i started to find a solution for that and finally found  by the member of the Flex_india_comm and he shared it in his blog and iam doing it in my blog.

So here is the solution for that:

First the Error tells Beta Expired which means that your SDK’s are expired, a timer in that is set so that it can be used only to that specified time and it cannot be Reset.And that means we cannot further use those SDK’s and change those SDK’s, so for that i downloaded the SDK’s 3 [previous SDK’s 2] from Adobe labs and i configured my project and added those new SDK’s to my projects, thats all  problem solved the Error Expired.

I will come back with screens for configuration 2mrow, until then take care.

Leave any comment for suggestion.


Generate XML data dynamically in Flex.

February 4, 2008

We may have a requirement were we wanted to generate XML data to send through Httpservice or create a XML page with it.

Then here to get that XML type data we could use a little bit of ActionScript code like below.

Here iam using XML Class and XMLList Class.

First iam defining my RootNode of type XML and then node name and node value of Type String and Then create a XMLList using this node name and node value,and then append this to XML RootNode using the method appendChild().Thats it ur XML data is created, now we can extend this to generate any number of XML lines type data.

Code Example:

private function createXML(): void
{
var xm:XML = <Relyon></Relyon>;
var nodeName:String = “EMPLOYEENAME”;
var nodeValue:String = “KUMAR”;
var xmlList:XMLList = XMLList(“<“+nodeName+”>”+nodeValue+”</”+nodeName+”>”);
xm.appendChild(xmlList);
Alert.show(xm);
}

This will do the JOB. Leave any comments for queries.


Traverse to previous page using JavaScript function.

February 1, 2008

When you are traveling to many pages you will have a requirement were you want to come back to the previous page[WEB page]. Then for this there is a function in JavaScript.

Function :

history.back();

Define this in a function in the JS and call that function from Flex APP using the ExternalInterface method call(), [previous post describes this call] with a button, the the JS function is raised and the Page is Traversed.

JS Code:

function previousPage()

{

history.back();

}

Refer previous post for ExternalInterface method call.