How would I use the following AS3 class within MXML?
AS3 Class:
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);
}
}
}
MXML Document:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Panel width="75%" height="75%" paddingTop="10" paddingLeft="10">
</mx:Panel>
</mx:Application>
Do I need to declare my own namespace? I am assuming it is possible to do something like:
//Where 'mtm' is my own namespace
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:mtm="com.mtm.*"></mx:Application>
And then do something like this?
<mtm:TestClass></mtm:TestClass>
I'm new to Flex and MXML, but not new to AS3. Thanks!