Archive

Archive for the ‘Air’ Category

Add Hand Cursor to Flex Tab Navigator

August 25, 2011 5 comments

In Flex Tab Navigator, you can’t have Hand Cursor when you mouse over the tab’s, I had to do little hack to achieve this.

Created two functions and linked them with mouse over and mouse out events.

Say your Tab Navigator’s id is “myTabNav”:

Here are the functions which would do the trick:

private function setHandCursor(event:MouseEvent):void
{
var classInfo:XML = describeType(event.target);
var cn:String = classInfo.@name.toString();
if(cn == “mx.controls.tabBarClasses::Tab”)
{
//this will bring the hand cursor

this.myTabNav.buttonMode = true;
this.myTabNav.useHandCursor = true;
}
}
private function removeHandCursor(event:MouseEvent):void
{
var classInfo:XML = describeType(event.target);
var cn:String = classInfo.@name.toString();
if(cn == “mx.controls.tabBarClasses::Tab”)
{
// this will remove the hand cusror

this.myTabNav.buttonMode = false;
this.myTabNav.useHandCursor = false;
}
}

 

you need to do as above otherwise the hand cursor will either show on complete Tab Navigator

Categories: ActionScript, Adobe, Air, Flex

How to set width of close button icon (Flex)

July 19, 2011 Leave a comment

Here is how you can set close button icon width and height of the TitleWindow:

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:TitleWindow xmlns:mx=”http://www.adobe.com/2006/mxml&#8221; layout=”absolute” width=”400″ height=”300″
creationComplete=”init()”>
<mx:Script>
<![CDATA[

import mx.core.mx_internal;

private function init():void
{
use namespace mx_internal;
if(mx_internal::closeButton!=null)
{
mx_internal::closeButton.buttonMode = true;
closeButton.$width  = 14; //Change the button width to 14 pixels
closeButton.$height = 14; //Change the button height to 14 pixels
}
}

]]>
</mx:Script>

<mx:Style>
TitleWindow{
border-color: #FFFFFF;
corner-radius: 10;
closeButtonUpSkin=Embed(source=”/com/test/skin/assets.swf”, symbol=”ButtonUp”);
closeButtonDownSkin=Embed(source=”/com/test/skin/assets.swf”, symbol=”ButtonUp”);
closeButtonOverSkin=Embed(source=”/com/test/skin/assets.swf”, symbol=”ButtonDown”);
}

</mx:Style>

</mx:TitleWindow>

Categories: ActionScript, Air, Flex

Flex Spy (fxSpy)

May 20, 2010 Leave a comment

This is a nice component, if you are a Flex Developer:

I found out this component today, when Anuj showed me.

This is very impressive, and useful to play with styles like you can do with firebug.

Here is the Project:

http://code.google.com/p/fxspy/

And an article by Anuj as well:

http://www.anujgakhar.com/2009/09/05/triggering-flexspy-with-a-keyboard-shortcut/

Another one from some developer:

http://blogs.warwick.ac.uk/stevencarpenter/entry/flex-spy_live_component

Categories: Adobe, Air, Flex, FlexSpy