Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Drawing rectangle dynamically AS3

Posted on 2009-04-07
1
Medium Priority
?
1,638 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

927 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