Bling, bling!

package

{

import flash.display.StageScaleMode;

import flash.display.StageAlign;

import flash.display.Sprite;

import flash.display.Graphics;

import flash.events.MouseEvent;

import flash.events.MouseEventType;

import flash.util.trace;


public class DrawingMouse extends Sprite

{


private var canvas_sprite:Sprite;


public function DrawingMouse()

{

stage.scaleMode = StageScaleMode.NO_SCALE;

stage.align = StageAlign.TOP_LEFT;


canvas_sprite = new Sprite();

addChild(canvas_sprite);

var g:Graphics = canvas_sprite.graphics;

g.clear();

g.beginFill(0x000000, 0);

g.lineTo(500, 0);

g.lineTo(500, 500);

g.lineTo(0, 500);

g.lineTo(0, 0);

g.endFill();


canvas_sprite.addEventListener(MouseEventType.MOUSE_MOVE, 
mouseMoveListener);

}


private function mouseMoveListener(event:MouseEvent)

{

trace("mouse move");

var g:Graphics = graphics;

g.clear();

g.lineStyle(2, 0x000000);

g.moveTo(100, 100);

g.lineTo(mouseX, mouseY);

g.endFill();

}


}

}

----- Original Message ----- 
From: "Mark Wales" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, October 30, 2005 5:05 PM
Subject: [flexcoders] Drawing Examples in Flex 2?



Has anyone spent any time drawing simple shapes (lines, circles, etc.)
in Flex 2?? Can someone point me to a couple examples? An ideal scenario
would be something that showed how to draw a line between a point and
the current location of the mouse.

Thanks in advance...






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to