I'll re-write this question to be clearer.
I'm trying to get a class file from Flash into Builder.
Everything in that class sits inside a Sprite called mainContainer. Now I'm trying to get that `mainContainer' which hold the graphics for the class into a Flex Application.
This is proving to be a problem as their are many various ways of doing it (it seems going by numerous Google searches).
First off I declare an MXML Canvas with an Image inside it (as I read would work):
<mx:Canvas x="268" y="10" width="756" height="680" id="canvas">
<mx:Image id="spriteLayer" x="268" y="0" width="756" height="700" scaleContent="false" autoLoad="true">
</mx:Image>
</mx:Canvas>}
Ok, my plan was then to pass the Image reference her of spriteLayer to the class I'm trying to run:
import includes.Spirograph;
public var spiro:Spirograph = new Spirograph(spriteLayer);
Unfortunately it only ever passes null into the Spirograph class:
function Spirograph(canvasImage:Image):void
{
this.canvas = canvasImage;
mainContainer.graphics.beginFill(0xFFFFFF);
mainContainer.graphics.drawRect(290, 0, 670, 700);
mainContainer.graphics.endFill();
ui.addChild(mainContainer);
canvas.addChild(ui);
}
Not sure what to do.
Many thanks.