Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Supporting Technologies > haXe

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-18-2009, 05:34 AM   #1
paul.sijpkes
Paul Sijpkes
 
Join Date: Mar 2008
Location: Newcastle, Australia
Posts: 14
Question fl.* libraries in haxe?

Hi everyone,

I want to be able to port an existing application which uses AS3 and PHP to haXe as I feel the workflow would be smoother, especially moving objects between haXe as3 and haXe PHP. I only have one problem, I really need the fl.controls.* and fl.events.* libraries.

Is there any way of building a swf that contains these libraries from Flash?

I use the fl.controls.TileList class which I have put on the stage in a file called lib.swf, this seems to solve the problem for importing the TileList, but not for the fl.events.ListEvent.

Any help would be greatly appreciated!

NB: Please don't suggest as3swing or arctic as I have already built most of this app and I don't have the time to re-code all the GUIs to use these libraries.
paul.sijpkes is offline   Reply With Quote
Old 08-19-2009, 02:01 AM   #2
paul.sijpkes
Paul Sijpkes
 
Join Date: Mar 2008
Location: Newcastle, Australia
Posts: 14
Default

I'm assuming the lack of responses indicates that haXe is either dead or that this is not possible, which sort of defies the whole point of haXe. It would be great if we could do this, and I think the adoption of haXe as a language would be much broader and faster if it was able interact fully with the existing libraries of the languages it is "pseudo" replacing. It appears to be a very powerful language, I was looking forward to using it. :-(

I think I am going to put my faith in the MCMLX compiler instead.
paul.sijpkes is offline   Reply With Quote
Old 08-27-2009, 06:30 PM   #3
Alex Lexcuk
Registered User
 
Join Date: Aug 2008
Posts: 21
Default

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
Alex Lexcuk is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:35 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.