title: How to use AS3 class in MXML?
body: <p>How would I use the following AS3 class within MXML?</p>
  
  <p>AS3 Class:</p>
  
  <pre><code>package mtm 
  {
    import flash.display.MovieClip;
    import flash.display.Shape;
  
    public class TestClass extends MovieClip
    {
  
        public function TestClass() 
        {
            var s:Shape = new Shape();
            s.graphics.beginFill(0x000000, 1);
            s.graphics.drawRect(0, 0, 60, 60);
            s.graphics.endFill();
            addChild(s);
        } 
    }
  }
  </code></pre>
  
  <p>MXML Document:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt;
          &lt;mx:Panel width="75%" height="75%" paddingTop="10" paddingLeft="10"&gt;
  
      &lt;/mx:Panel&gt;
  &lt;/mx:Application&gt;
  </code></pre>
  
  <p>Do I need to declare my own namespace? I am assuming it is possible to do something like:</p>
  
  <pre><code>//Where 'mtm' is my own namespace
  &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:mtm="com.mtm.*"&gt;&lt;/mx:Application&gt;
  </code></pre>
  
  <p>And then do something like this?</p>
  
  <pre><code>&lt;mtm:TestClass&gt;&lt;/mtm:TestClass&gt;
  </code></pre>
  
  <p>I'm new to Flex and MXML, but not new to AS3.
  Thanks!</p>