Solved

Drawing rectangle dynamically AS3

Posted on 2009-04-07
1
1,613 Views
Last Modified: 2013-11-11
Hi everyone,

I want to be able to dynamically draw multiple rectangles dynamically onto a stage but I'm not sure how to go about doing that. What I was thinking was this:
1. When user clicks on screen, start drawing at x,y
2. Whenever the mouse moves, update the screen with the new x,y to get the rectangle (but if the user hasn't moved the mouse yet, keep the rectangle with height and width to be 0, 0).
3. Once user let's the mouse go, don't update the rectangle anymore.

But I want to also allow the user to change the width and height once they create the rectangle. And when the user clicks on the side of the ages, be able to change it that way too.

It would be exactly what they would have as selection tools in image editors. Any idea how to program out?
0
Comment
Question by:dsrnu
1 Comment
 
LVL 19

Accepted Solution

by:
Gary Benade earned 500 total points
ID: 24085585
You could use something like the object handle component, you should be able to get the code you need out of the source

http://code.google.com/p/flex-object-handles/
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now