Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1639
  • Last Modified:

Drawing rectangle dynamically AS3

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
dsrnu
Asked:
dsrnu
1 Solution
 
Gary BenadeCommented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now