Close the browser window from Flex App.

August 7, 2009

Using two lines of javascript code we can actually close the Browser window.But not all the Browser’s support this feature[works on IE], they only give limit access through javascript.But as the question is made here is the solution.

function closeme()
{
 window.close();
}

this is the js code.So how you gonna make this function call from the Flex App?.Simple use ExternalInterface.

Read the rest of this entry »

Advertisements

A Flex Application done to File your Income Tax Returns, awaiting comments.

July 18, 2008

Dear Friends,

My Team members have done one Application in Flex where in you can File your Income Tax Returns, and one small Utility in Flex where in you can do Tax calculation called Tax Calci [with my involment].

As Its very important to file your Income Tax returns, Just go ahead and file your return, 31-07-2008 [India]is the last date to file your returns

And the Links are www.saralefile.com —  Here you can file your individual income tax returns

And Tax Calculator Utility Link : www.taxcalc.saralefile.com

And  guess what its Free?

The comments are welcome and we are awaiting for that.

With Regards,
K.Kumar Gandhi.

http://99thoughts.com/


Refresh/Reload Flex App using JavaScript code.

February 12, 2008

When you search to accomplish a task in Flex and can’t do it, then look for it in JavaScript because many of things that are not possible in Flex are possible using JavaScript which is the backbone of your Flex App.

I had a requirement were i wanted to refresh/reload the Flex App ,but i couldn’t do it in Flex and finally i realized that it may be possible using JavaScript then i went for it and coded, “WOW” i said to my self because it worked ,my App got reloaded/refreshed.

Then decided to post it in Blog, because it may help out other Flex lovers.

Code Example:

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml&#8221; layout=”absolute”>
<mx:Button x=”83″ y=”196″ label=”Button” click=”reloadpage(event)”/>
<mx:Script>
<![CDATA[
private function reloadpage(event:MouseEvent):void
{
var ref:URLRequest = new URLRequest(“javascript:location.reload(true)”);
navigateToURL(ref, “_self”);
}
]]>
</mx:Script>
</mx:Application>

Here on click of Button the App is reloaded/refreshed.Isn’t cool.


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.


JavaScript function to travel to a WEB Page : redirect()

January 31, 2008

In flex we use navigateToUrl () method to traverse to a WEB page, usually with a link Button or Button.

So how to do this with Javascript code behind the flex App, the solution is simple with a line a code.

The line is :

window.location.href=””;

specify the link in the double quotes.

Example:

In flex iam having Button which calls the function redirect() at JS,which contains the line of code, then definition would be as below..,

Code at Flex app:

<mx:Button id=”btn” click=”b()”/>

<script>

private function b():void

{

ExternalInterface.call(“redirect”);

}

</script>

Code at JS/html wrapper:

<script language=”javascript”>

function redirect()

{

 window.location.href=”http://www.google.com/&#8221;

}

</script>

Now on click Button the page will travel to the Google Page.