Hey Flashkit!
What i'm trying to do is make a drag able square and use a different cursor that I made to do so. It worked fine until I added the code for the cursor. Help?
PHP Code:
//Creating the Rectangle
var imgWidth:Number=rec.width;
var imgHeight:Number=rec.height;
var rectWidth:Number=bg.width;
var rectHeight:Number=bg.height;
var rectX:Number=bg.x;
var rectY:Number=bg.y;
var boundWidth=rectWidth-imgWidth;
var boundHeight=rectHeight-imgHeight;
var boundsRect:Rectangle=new Rectangle(rectX,rectY,boundWidth,boundHeight);
//-----------------------------------------------------------------------------------------------------------
rec.addEventListener(MouseEvent.MOUSE_DOWN, DragWindow1); //Conflict?
function DragWindow1(event:MouseEvent):void
{
rec.startDrag(false, boundsRect);
}
//-----------------------------------------------------------------------------------------------------------
rec.addEventListener(MouseEvent.MOUSE_UP, DropWindow1);
rec.addEventListener(MouseEvent.MOUSE_OUT, DropWindow1);
function DropWindow1(event:MouseEvent):void
{
rec.stopDrag();
}
//-----------------------------------------------------------------------------------------------------------
//CURSOR
stage.addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor); //Conflict?
stage.addEventListener(Event.MOUSE_LEAVE, hideCursor);
Mouse.hide();
function redrawCursor(event:MouseEvent):void
{
myCursor_mc.visible=true;
myCursor_mc.x=event.stageX;
myCursor_mc.y=event.stageY;
}
function hideCursor(event:Event):void
{
myCursor_mc.visible=false;
}