-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
127 lines (108 loc) · 3.26 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
===========
Config file
===========
as3hx looks for, or creates, a config file in your home directory
called ".as3hx_config.xml". You can also create one in the directory
you are running as3hx from, which will override the home file.
indentChars: (String=\t)
The characters used to indent each line
newlineChars: (String=\n)
The characters used to terminate each line
bracesOnNewline: (Bool=true)
If set, opening braces will be put on a new line
uintToInt: (Bool=false)
If set, all uint in flash will be translated to Int
vectorToArray: (Bool=false)
If set, all Vectors will be changed to Arrays
guessCasts: (Bool=true)
Cast guessing should likely be on, as it will change
any MyClass(obj) to a cast(obj, MyClass) call.
functionToDynamic: (Bool=false)
If set, Function will be translated to Dynamic
getterMethods: (String=get%I)
Can be set to change the names of getters.
%I : field name with first letter capitalized
%i : field name unchanged (ex. get_%i)
setterMethods: (String=set%I)
Can be set to change the names of setters
getterSetterStyle: (String="haxe")
"haxe": a field will be created with haxe style setters
and getters. (var m(getM,setM))
"flash": only native getters and setters will be created
using @:getter and @:setter
"combined": both will be generated
For the "combined" getterSetterStyle, code output will look
similar to:
#if flash
@:getter(target) function get_target() : {} {
return proxy;
}
#else
override function get_target() : Dynamic {
return proxy;
}
#end
=================
Current failures:
=================
================================
'delete' keyword:
================================
In actionscript, the delete keyword will cause an intentional failure in the
generated .hx file. Take a close look at the object being deleted.
1) if it is a local variable, replace 'delete varname' with 'varname = null'
2) if it is a class member variable, remove the delete entirely
3) it it is an E4X (FastXML), well, hmmm... still working on that one.
Senocular did a little writeup on 'delete' that might make it more clear
http://www.kirupa.com/forum/showthread.php?223798-ActionScript-3-Tip-of-the-Day/page3
================================
E4X:
================================
E4X is currently partly done. This will fail in some cases, just examine source
and output carefully.
================================
For Initializations:
================================
The output of
if(true) {
for(var i:uint = 0; i < 7; i++)
val += "0";
} else {
for(i = 0; i < 8; i++)
val += "0";
}
is
if(true) {
var i : UInt = 0;
while(i < 7) {
val += "0";
i++;
}
} else {
i = 0;
while(i < 8) {
val += "0";
i++;
}
}
As you can see, the scope of "i" in flash is not the same as in haxe,
so the "else" section will produce Unknown identifier : i. The solution
is to move the "var i : UInt = 0;" outside of the blocks in the generated
code.
This can not be avoided by always creating the i variable, as the code
for(var i:uint = 0; i < 7; i++)
val += "0";
for(i = 0; i < 8; i++)
val += "0";
would then produce a double initialization of i, also causing a compiler error.
var i : UInt = 0;
while(i < 7) {
val += "0";
i++;
}
var i = 0;
while(i < 8)
{
val += "0";
i++;
}