fl.* in haxe - it's easy
Open flash cs3.
ctrl+l
ctrl+F7
drag all component in library
save fla file as name component
ctrl+enter -> has got component.swf
gen clases example
Code:
D:\FLEX\hahe\component>haxe --gen-hx-classes D:\FLEX\hahe\component\conponent.swf
ENTER
Code:
import fl.managers.IFocusManagerComponent;
import fl.managers.IFocusManagerGroup;
import fl.controls.listClasses.ICellRenderer;
import fl.controls.listClasses.ListData;
...
...
...
import fl.controls.ScrollPolicy;
import fl.events.DataChangeType;
I am uses flashdevelop -> project -> haxe -> Empty project
new class
Code:
/**
* ...
* @author http://www.murmadillo.tut.su/
*/
package ;
import fl.controls.Button;
import flash.Lib;
import flash.display.MovieClip;
class HaxeDoc
{
public function new()
{
}
static function main() {
trace('hello');
flash.Lib.current.addChild(new DocDemoComponent());
}
}
new class
Code:
/**
* ...
* @author http://www.murmadillo.tut.su/
*/
package ;
import fl.controls.TextArea;
import flash.display.Sprite;
import fl.controls.Button;
class DocDemoComponent extends Sprite
{
public function new()
{
super();
var bt:Button;
addChild(bt = new Button());
bt.x = 30;
bt.y = 30;
var txt:TextArea;
addChild(txt = new TextArea());
txt.x = 30;
txt.y = 60;
txt.setSize(500, 300);
txt.text = 'Hello HAXE';
for (i in 0...30) txt.appendText(i+'\n');
}
}
project -> properties -> build -> pre-build command line
Code:
haxe -main HaxeDoc -swf-lib component.swf -cp hxclasses -swf Main.swf -swf-version 9
F5 ERROR
Code:
hxclasses/fl/controls/Button.hx:3: lines 3-11 : Field mouseFocusEnabled has different property access than in fl.managers.IFocusManagerComponent (default should be null)
hxclasses/fl/controls/Button.hx:3: lines 3-11 : Field tabEnabled has different property access than in fl.managers.IFocusManagerComponent (default should be null)
hxclasses/fl/controls/Button.hx:3: lines 3-11 : Field tabIndex has different property access than in fl.managers.IFocusManagerComponent (default should be null)
hxclasses/fl/controls/LabelButton.hx:3: lines 3-21 : Field mouseFocusEnabled has different property access than in fl.managers.IFocusManagerComponent (default should be null)
hxclasses/fl/controls/LabelButton.hx:3: lines 3-21 : Field tabEnabled has different property access than in fl.managers.IFocusManagerComponent (default should be null)
hxclasses/fl/controls/LabelButton.hx:3: lines 3-21 : Field tabIndex has different property access than in fl.managers.IFocusManagerComponent (default should be null)
hxclasses/fl/controls/TextArea.hx:3: lines 3-60 : Field mouseFocusEnabled has different property access than in fl.managers.IFocusManagerComponent (default should be null)
hxclasses/fl/controls/TextArea.hx:3: lines 3-60 : Field tabEnabled has different property access than in fl.managers.IFocusManagerComponent (default should be null)
hxclasses/fl/controls/TextArea.hx:3: lines 3-60 : Field tabIndex has different property access than in fl.managers.IFocusManagerComponent (default should be null)
open file IFocusManagerComponent.hx
Code:
package fl.managers;
extern interface IFocusManagerComponent {
var focusEnabled : Bool;
var mouseFocusEnabled(default,null) : Bool;
var tabEnabled(default,null) : Bool;
var tabIndex(default,null) : Int;
function drawFocus(p0 : Bool) : Void;
function setFocus() : Void;
}
way of the experiment
Code:
package fl.managers;
extern interface IFocusManagerComponent {
var focusEnabled : Bool;
//var mouseFocusEnabled(default,null) : Bool;
//var tabEnabled(default,null) : Bool;
//var tabIndex(default,null) : Int;
function drawFocus(p0 : Bool) : Void;
function setFocus() : Void;
}
F5
OK works well
http://www.murmadillo.tut.su/m/haxe_fl_component.zip