1 Reply Latest reply on Dec 4, 2006 3:54 PM by Newsgroup_User

    Making a rectangle by Actionscript

    Kia70
      I am newbie and I am trying to make a rectangle by only using Actioinscript, also flash.geom.Rectangle.
      My code looks as follow:

      import flash.geom.Rectangle;
      var window:Rectangle = new Rectangle(0, 0, 100, 40);

      But I don't see any rectangle. I think I am missing something here. What can it be?
        • 1. Re: Making a rectangle by Actionscript
          Level 7
          Kia70,

          > I am newbie and I am trying to make a rectangle by only
          > using Actioinscript, also flash.geom.Rectangle.

          Okay.

          > My code looks as follow:
          >
          > import flash.geom.Rectangle;
          > var window:Rectangle = new Rectangle(0, 0, 100, 40);

          Aha. Well, that creates an instance of the Rectangle class. This is a
          Rectangle object, but not a visual object, such as a movie clip, button, or
          text field.

          > But I don't see any rectangle. I think I am missing something
          > here. What can it be?

          You're missing the Drawing API. Check out the MovieClip class, which
          contains the Drawing API among its members. Start with MovieClip.lineTo()
          in the ActionScript 2.0 Language Reference and you'll find the path you're
          looking for.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."