Dynamic cursors


SimpleCursorExample.mxml

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”&gt;
<mx:Script>
<![CDATA[
import com.harrisfamily.cursors.Circle;
import com.harrisfamily.cursors.Ellipse;
import com.harrisfamily.cursors.Rect;
import com.harrisfamily.cursors.RoundRectComplex;
import mx.managers.CursorManager;
private function setCursor( cursorClass:Class = null ):void
{
CursorManager.setCursor( cursorClass );
}
private function clearCursor():void
{
CursorManager.removeAllCursors();
}
]]>
</mx:Script>
<mx:Tile horizontalGap=”25″    verticalGap=”25″>
<mx:Panel title=”Circle Cursor” mouseOver=”setCursor( Circle );” mouseOut=”clearCursor();”
height=”250″ width=”250″/>
<mx:Panel title=”Ellipse Mouse” mouseOver=”setCursor( Ellipse );” mouseOut=”clearCursor();”
height=”250″ width=”250″/>
<mx:Panel title=”Rect Mouse” mouseOver=”setCursor( Rect );” mouseOut=”clearCursor();”
height=”250″ width=”250″/>
<mx:Panel title=”RoundRectComplex Mouse” mouseOver=”setCursor( RoundRectComplex );”
mouseOut=”clearCursor();” height=”250″ width=”250″/>
</mx:Tile>
</mx:Application>

Circle.as

package com.harrisfamily.cursors
{
import flash.display.Sprite;
public class Circle extends Sprite
{
public function Circle()
{
this.graphics.lineStyle( 1 , 0x000000 , 1 );
this.graphics.drawCircle( 0 , 0 , 10 );
super();
}
}
}

Ellipse.as

package com.harrisfamily.cursors
{
import flash.display.Sprite;
public class Ellipse extends Sprite
{
public function Ellipse()
{
this.graphics.lineStyle( 1 , 0x000000 , 1 );
this.graphics.drawEllipse( 0 , 0 , 50 , 10 );
super();
}
}
}

Rect.as

package com.harrisfamily.cursors
{
import flash.display.Sprite;
public class Rect extends Sprite
{
public function Rect()
{
this.graphics.lineStyle( 1 , 0x000000 , 1 );
this.graphics.drawRect( 0 , 0 , 40 , 15);
super();
}
}
}

RoundRectComplex.as

package com.harrisfamily.cursors
{
import flash.display.Sprite;
public class RoundRectComplex extends Sprite
{
public function RoundRectComplex()
{
this.graphics.lineStyle( 1 , 0x000000 , 1 );
this.graphics.drawRoundRectComplex( 0 , 0 , 45 , 25 , 5 , 0 , 0 , 5 );
super();
}
}
}

Advertisements

~ by mjcprasad2000 on July 11, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: