fairygui/FairyGUI-as3

Use generated code with AS3

Endothelium opened this issue · 1 comments

Hello,

I am using generated code to integrate components i made with fairy editor into my AS3 project.

Is there ressources on how to use generated code with AS3 project?

Actually i have this component "Scene":

package com.imvu.valr.easydj.ui
{
	import fairygui.*;

	public class Scene extends GComponent
	{
		public var klklkl:Label;

		public static const URL:String = "ui://pnvy8odpe2k50";

		public static function createInstance():Scene
		{
			return Scene(UIPackage.createObject("ui","Scene"));
		}

		public function Scene()
		{
		}

		protected override function constructFromXML(xml:XML):void
		{
			super.constructFromXML(xml);

			klklkl = Label(this.getChild("klklkl"));
		}
	}
}

And i want to use this class with this piece of code :

var ui:Scene = Scene.createInstance();
context.addChild(ui.displayObject);

But actually, ui is always NULL.
How can i do this?

Thanks

Ok i found the solution by using the demo.

Maybe you should document it more.

Thanks :)