Tour India

I love travelling . In this catagory of my post I will be posting about the places which I have visited and would like to describe few of the things which I liked .– So continue visiting the post if you want to explore. :) njoy…………

Texas Hold’em – Poker Hands

Basically poker is a game of getting best hand. And by the hand only we can win more the pot value. In texas hole’m user have 2 hole cards and 5 community cards and from these 7 cards we make the best combination of 5 cards considering hole cards and community cards and that is called as Hand . Hand card decides the game of user how he is going to raise the pot amount and win the pot too. It has basically 10 types of combination that can be formed for hand cards. These are described below.

navigateToURL problem in Firefox

I was stuck somewhere when I have to open a new window in Flash AS3 using navigateToURL. In my work I have to open a image .jpg file in a new/other window when user click on the size of the image . Its working fine when I tested it with IE7 but it didnt work in Firefox. I googled for this I got some solution but that again didnt work for me in FF. The problem what I figured out  is when we open a new window through navigateToURL in FF it blocks if your setting of FF for Block Window popup is checked. I unchecked that and ecerything works fine for me in my system.

I am using

var urlReq:URLRequest = new URLRequest(urlToOpen);
 navigateToURL(urlReq,”_blank”);

Any one knows how to solve the problem when   Block Window popup is being checked , please let me know. Thanks..:)

Capture window close button with javascript

To capture close button of window in javascript we need to write a function in the html code as :-

<html>
<script language=”JavaScript” type=”text/JavaScript”>
 function checkForExit(evt){
  alert(‘what ever you want to do code here’);
 }
</script>
Then call the function inside body tag  as:-
<body onBeforeUnload=”return checkForExit();”>
……………
</body></html>

onReleaseOutside in AS3

Event onReleaseOutside is removed from as3 for this we can do now is add an event listenter to stage mouse up and call the method for the same. eg:

movieClip.addEventListener(MouseEvent.MOUSE_DOWN, MCPressed);

function MCPressed(e:Event):void{

//////// do what you want then

stage.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);

}

function mouseReleased(e:Event):void{

// do what you what

stage.removeEventListener(MouseEvent.MOUSE_UP, mouseReleased);

}

Calling server method from client side in FMS

Let say you want to call a method called calledFromClient from client side script to media server.

In Media server it is defined as

Client.prototype.calledFromClient=function(parametes){

// internal code here

}

let _nc is the NetConnection variable then in client side it is called as:-

_nc.call(“calledFromClient”, null,parameters);

:) njoy…….

Getting color in hexadecimal form from color picker

Suppose you are using color picker in a flex application. You want to get the color selected by the user throught color picker in hexadecimal form so that you can use the same color some where else in that application.

<mx:ColorPicker x=”476″ y=”145″ showTextField=”true” id=”colorPickerID” change=”changed()”/>

changed() is the function called when user changes the color of the color picker .

public function changed():void{

var colorSelected = colorPickerId.selectedColor.toString(16);

}

colorSelected is the color what you wanted

:) njoy………

Random colors in Flash

If you are looking for the easiest way to get the random colors through actionscript go for the code

var color = Math.round( Math.random()*0xFFFFFF );

:) njoy……

Google Chrome (Beta)

Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier.

Download the beta google chrome brower http://www.google.com/chrome  and for knowing about its feature  http://www.google.com/chrome/intl/en/features.html

Retrieving attributes name of xml tag in as3.0

Let say the xml you loaded is

<main >
 <chart Month=”Jan” Profit=”1200″ Expence=”700″/>
 <chart Month=”Feb” Profit=”1500″ Expence=”900″/>
 </main>

Now you wnat to get the nodeValue of Jan 1200 700 etc. That was able to achieve by traversing the xml and then .nodeValue is as2 we can do the same in as3 but now we have to make this as xmlDocument first. There is another solution here for as3 developer. In the same you can traverse the xml here I am using fixed index to get the value—-

Suppose you loaded the xml in variable myXML, The node value will be

myXML.chart[0].attributes()[0].name()  —- This will return you Month Similarly you can get others too

:)  njoy……