Solved

Drawing rectangle dynamically AS3

Posted on 2009-04-07
1
1,631 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

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…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

635 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