I am a c+-#? programmer and am getting killed by this programming environment. AS in flex has been great, straight forward, no problems. Now that I am trying to integrate it into MXML, I want to shoot myself. I have a standalone app in AS, that is basically a CAD/drawing program. Now I want it to live inside a nice graphical environment with buttons for controls. I could keep using AS, but it seems most people use MXML. So the class is called "test" and I dont know how to make an object in MXML and then draw it. Here is the MXML code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!--usingas/eightCAD.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script><![CDDATA[
import test;
public var x:test = new test();
]]></mx:Script>
<mx:Button id="b1" label="Draw"
click="x.drawBoard();"/>
</mx:Application>
and the AS code starts as:
Code:
package {
import flash.display.Sprite;
import flash.display.Shape;
import flash.geom.Point;
import flash.geom.Matrix;
import flash.events.MouseEvent;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.display.BitmapData;
public class test extends Sprite
{
private var imgLoader:Loader;
private var boardSprite:Sprite = new Sprite();
Thanks for any help!