You'll have to have Flex Builder 2 installed. Just start a new Action Script Project (File->New->ActionScrip Project). Let's name it Test4. After the project is created, Flex Builder creates a default class named Test4.as. Double click on it and replace it's default content with the one provided by JesterXL.
It worked form me! --- In [email protected], "Mark Wales" <[EMAIL PROTECTED]> wrote: > > > Thanks Jesse - this certainly looks like the right approach - > unfortunately I've not been able to get it to work. I've tried calling > it directly within MXML, calling it from a creationComplete function, > and embedding the SWF in an existing simple application. I'm sure I'm > missing something obvious, any thoughts? > > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of JesterXL > Sent: Monday, October 31, 2005 12:51 AM > To: [email protected] > Subject: Re: [flexcoders] Drawing Examples in Flex 2? > > 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 > > > > > > > > > -- > 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 --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/cd_AJB/QnQLAA/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/

