Advertisement

01.29.2008 at 06:20PM PST, ID: 23121572
[x]
Attachment Details

create/display and access multiple rectangles

Asked by gotaquestion in Game Programming, Macromedia Flash

Tags: flash actionscript 3

i am just learning actionscript 3.
goal: i want to create and display multiple rectangles inside of  a group and at runtime access and change the rect properties like background color etc when the users' mouse clicks on a specific rectangle.

below is my first attempt to create a rectangle.  but then I couldn't access it after I added it to the group.


      var rect1:Shape = new Shape();
      var group:Sprite = new Sprite();

      rect1.graphics.lineStyle(1);
      rect1.graphics.beginFill(0x0000FF,1);
                     rect1.graphics.drawRect(100,30,75,50);
      rect1.rotation = 45;

                addChild(rect1);

                 group.addChild(rect1);

then I saw this method
var rect2:Rectangle = new Rectangle();

but that seems to just create something in memory and not display.  but it seems this constructor is good for me becuase it gives me methods like containPoints()

thanks.
       

             


Start Free Trial
[+][-]01.29.2008 at 06:57PM PST, ID: 20774286

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Game Programming, Macromedia Flash
Tags: flash actionscript 3
Sign Up Now!
Solution Provided By: julianopolito
Participating Experts: 2
Solution Grade: A
 
 
[+][-]02.09.2008 at 09:40PM PST, ID: 20860219

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02.10.2008 at 05:03AM PST, ID: 20860931

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.10.2008 at 06:18AM PST, ID: 20861127

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.02.2008 at 07:04AM PDT, ID: 21263116

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628