Re: FlexJS MXML ids and classNames

2016-08-07 Thread Andy Dufilie
On Sun, Aug 7, 2016 at 7:09 AM, Harbs wrote: > I also noticed that setting the className of a UIBase sets the class of > the element, but setting the id does not set the element id. That does not > seem right to me. Any reason to not add the id to the element as well? > In MXML, the "id" propert

Re: [FlexJS] with ReactJS

2016-06-03 Thread Andy Dufilie
You can use React in TypeScript with the type definitions here: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/react My team is using React in TSX which references AS libraries typed with as2dts. For my work, the major advantage AS has over TS is the is/as operators which can check

Re: why can not open this code?

2016-05-26 Thread Andy Dufilie
On Wed, May 25, 2016 at 9:44 PM, lizhi wrote: > yes,i will try.but i do not know.why no debug theyself of flexjs sdk > developer? > why not do not like check out the spriteflexjs code.and debug. > > it is a sdk bug,look at the bug,will improte the flexjs sdk. > > why not it just useful for myself

Re: why can not open this code?

2016-05-25 Thread Andy Dufilie
The way I would debug this is to open Chrome dev tools and enable "Pause on exceptions" using the button circled here: http://image.prntscr.com/image/dcc65ace5dd146718a7c608619b6521d.png Just refresh the page after enabling that option and Chrome will show you the stack trace of the error and allo

Re: why can not open this code?

2016-05-24 Thread Andy Dufilie
I think Alex is right that the problem is your BitmapData.as constructor calls super() yet the BitmapData class does not extend anything. That would explain the TypeError on line 2367 because parentCtor would be undefined. Try removing this line: https://github.com/matrix3d/spriteflexjs/blob/mast

Re: why can not open this code?

2016-05-24 Thread Andy Dufilie
Hi lizhi, Most of us read the forum via e-mail and the Nabble forum website does not forward attached images through e-mail, so we did not realize you had shared a screenshot. >From the screenshot, the errors are: Uncaught TypeError: Cannot read property 'prototype' of undefined. base.js:2367 Unca

Re: AW: AW: why can not open this code?

2016-05-21 Thread Andy Dufilie
Copying and pasting error messages may help. Screenshots may help as well. Andy On May 21, 2016 5:44 PM, "lizhi" wrote: > > i want push more details. > but i do not speak english good. > so i can not get the details. > i am sorry. > .

Re: [FlexJS]as int

2016-05-18 Thread Andy Dufilie
omething like this: > > function asInt(value){ > var intVal:int = int(value);//this should call parseInt() > var numVal:Number = parseFloat(value) > return intVal == numVal ? intVal : 0; > } > > On May 18, 2016, at 1:20 PM, Andy Dufilie wrote: > > > On May 1

Re: [FlexJS]as int

2016-05-18 Thread Andy Dufilie
On May 18, 2016 2:50 AM, "Harbs" wrote: > > Isn’t this a behavior change? > > What happens if you do "5.3 as int” in ActionScript? Don’t you get 5? > I just tested this and got null.

Re: [FlexJS]as int

2016-05-16 Thread Andy Dufilie
There is no "int" type in JavaScript, so I think the compiler should just replace int with Number. In general I would not recommend using "as Number" or "as int" anyway, since it returns null if the value is of a different type, and null cast to Number or int becomes zero rather than NaN. On Mon,

Re: [FlexJS]TimerEvent

2016-05-10 Thread Andy Dufilie
On May 9, 2016 1:27 PM, "Alex Harui" wrote: > > > I would not be in favor of actually copying constants since it would add > to bloat. I'd rather work on inlining constants and looking up the chain > at compile-time to find values to inline. > Inlining constants would only work correctly for str

Re: flexjs foreach very slow

2016-05-10 Thread Andy Dufilie
You're right, it is possible, but I think the key word there was "easily." :) Sent from my Android On May 9, 2016 23:59, "Alex Harui" wrote: > > > On 5/9/16, 1:22 PM, "Josh Tynjala" wrote: > > >That's a good call, Andy. You're absolutely right that a for-each loop > >could also have its own ret

Re: flexjs foreach very slow

2016-05-09 Thread Andy Dufilie
There can also be return statements within loops as well as "break to label" or "continue to label". It all seems very messy to me and I still think it should be behind an optimization option. The current implementation works perfectly and I would prefer the JS output to be minimally different fr

Re: flexjs foreach very slow

2016-05-07 Thread Andy Dufilie
If you do make this change it should be an optional compiler argument, because this changes the behavior of the code. The following loop should print 1 and 2, not undefined: var array = []; array[2] = 1; array[4] = 2; for each (var x in array) trace(x); On May 7, 2016 10:18 AM, "Alex Harui"

Re: [FlexJS]ByteArray and Dictionary

2016-04-15 Thread Andy Dufilie
The Mozilla StringView project is LGPL 3.0 so we would have to ask if they can change the license or swap it out with something else. On Fri, Apr 15, 2016 at 2:27 PM, Andy Dufilie wrote: > I'm fine with that. It also uses StringView by Mozilla, ported to AS from > JS: > > h

Re: [FlexJS]ByteArray and Dictionary

2016-04-15 Thread Andy Dufilie
wrote: > > > On 4/15/16, 6:57 AM, "Andy Dufilie" wrote: > > >I've ported a JavaScript ByteArray implementation to ActionScript and > >fixed > >several bugs here: > > > https://github.com/WeaveTeam/Weave/blob/develop/WeaveJS/src/weavejs/util/J

Re: [FlexJS]ByteArray and Dictionary

2016-04-15 Thread Andy Dufilie
I've ported a JavaScript ByteArray implementation to ActionScript and fixed several bugs here: https://github.com/WeaveTeam/Weave/blob/develop/WeaveJS/src/weavejs/util/JSByteArray.as (original: https://github.com/jamesward/JSAMF/blob/master/web/web/amf.js) It does not have any write functionality

Re: [FlexJS] dts2as, meet as2dts (was: Release FlexJS/FalconJX 0.6.0)

2016-03-19 Thread Andy Dufilie
On Tue, Mar 15, 2016 at 8:00 PM, Alex Harui wrote: > > I just took a quick look at React. What is it you like about it? If it > is the actual UI library itself, I would have to wonder what it would take > to wrap up their UI Library so it could be used in MXML. The JSX I saw > seemed to have a

Re: [FALCONJX] Allowing certain kinds of overrides

2016-03-19 Thread Andy Dufilie
That feature sounds fine to me. On Thu, Mar 17, 2016 at 8:58 PM, Alex Harui wrote: > Hi, > > As I've been trying to get FlexJS to compile Flex code, there are some > pain points. One is the parent property of UI widgets. > > In IUIBase.as, we want the parent to be another IUIBase > > functi

Re: [2/2] git commit: [flex-falcon] [refs/heads/develop] - apparently, parseInt in JS should always specify the radix

2016-03-19 Thread Andy Dufilie
The latest browsers do not support the octal case anymore so I'm inclined to say it should be left alone. I doubt it would ever be an issue. On Tue, Mar 15, 2016 at 7:55 PM, Alex Harui wrote: > > > On 3/15/16, 3:57 PM, "omup...@gmail.com on behalf of OmPrakash Muppirala" > wrote: > > >I think

Re: [2/2] git commit: [flex-falcon] [refs/heads/develop] - apparently, parseInt in JS should always specify the radix

2016-03-15 Thread Andy Dufilie
Mar 15, 2016 at 4:52 PM, Alex Harui wrote: > > > On 3/15/16, 1:49 PM, "Alex Harui" wrote: > > > > > > >On 3/15/16, 1:35 PM, "Andy Dufilie" wrote: > > > >>It's not a good idea to make built-in functions behave differently in JS

[FlexJS] dts2as, meet as2dts (was: Release FlexJS/FalconJX 0.6.0)

2016-03-15 Thread Andy Dufilie
This is great - I didn't know dts2as [1] was a thing. I recently forked as3-to-typescript [2] which uses code ported to TypeScript from FlexPMD [3], fixed all the bugs I could find, and made it output just definitions rather than trying to generate all the AS code in TS syntax. After hearing about

Re: [2/2] git commit: [flex-falcon] [refs/heads/develop] - apparently, parseInt in JS should always specify the radix

2016-03-15 Thread Andy Dufilie
It's not a good idea to make built-in functions behave differently in JS versus AS. It's not a required param in AS, and this change makes the following evaluate to true in AS but false in the cross-compiled JS: Number("0xFF00FF") == parseInt("0xFF00FF") On Tue, Mar 15, 2016 at 3:22 PM, Alex H

Re: [FLEXJS][FALCONJX] The Date class

2016-02-24 Thread Andy Dufilie
On Feb 23, 2016 19:34, "Alex Harui" wrote: > OK, so I'll get the compiler to map Date's properties to getX/setX calls. > > For Array.sort, I guess we should map it to some other function in some > other class. Should we generalize such a mapping or is that the only one? > > -Alex > > These cons

Re: [FLEXJS][FALCONJX] The Date class

2016-02-23 Thread Andy Dufilie
aightforward but anything not as obvious just get flagged. > > > >My 2 cents, > >Peter Ent > >Adobe Systems/Apache Flex Project > > > >On 2/23/16, 1:44 PM, "Andy Dufilie" wrote: > > > >>AS has getHours() and setHours() too. If the code is upda

Re: [FLEXJS][FALCONJX] The Date class

2016-02-23 Thread Andy Dufilie
AS has getHours() and setHours() too. If the code is updated to use those it should work. Date is not the only class that has differences - Array.sort() is not the same in AS and JS. I think the most the compiler should do is provide a warning when using known AS features that do not exist in JS,

Re: [FalconJX] null vs undefined

2016-02-10 Thread Andy Dufilie
Untyped variables are undefined by default. ActionScript does automatic coercion when a variable is typed, so it becomes null for String or Object, NaN for Number, or 0 for uint/int. Currently, this automatic coercion is lost during cross-compilation. On Wed, Feb 10, 2016 at 4:30 PM, Harbs wrote

Re: [FALCONJX][FLEXJS] XML handling (was Re: [FlexJS] Back port)

2016-02-07 Thread Andy Dufilie
The insert code looks fine to me, assuming children of XML are stored as properties "0", "1", "2", ... It's shifting all children with index >= i and saving P starting at child index i. [[Put]] is overwriting a child at a given index, and insertChildBefore/insertChildAfter/prependChild should be d

Re: Building FlexJS from source

2016-01-20 Thread Andy Dufilie
On Wed, Jan 20, 2016 at 1:35 PM, Alex Harui wrote: > The FlashPlayerDebugger can be downloaded from > http://www.adobe.com/support/flashplayer/downloads.html > (it says so in our READme ;-)) > > That's where I get the debugger for the browser, but I wasn't sure specifically where FlashPlayerDebug

Re: Building FlexJS from source

2016-01-20 Thread Andy Dufilie
I've been struggling for a while trying to find the right settings that will let me build FlexJS from the git repositories on Windows. I've documented my steps here now that I've managed to get the flex-asjs/build.xml/binary-release ant target to work: https://github.com/adufilie/flex-dev-setup. I

Re: ERROR - Circular dependency detected: A -> B -> A

2016-01-19 Thread Andy Dufilie
On Tue, Jan 19, 2016 at 2:39 PM, Alex Harui wrote: > IMO, a base class shouldn't know about any extensions. > I agree, and I don't think we should bend over backwards trying to support this pattern.

Re: ERROR - Circular dependency detected: A -> B -> A

2016-01-16 Thread Andy Dufilie
In the latest version, FalconJX does not remove circular dependencies by default. You must specify -remove-circulars when running the build command. On Jan 16, 2016 04:55, "lizhi" wrote: > package > { > /** > * ... > * @author lizhi > */ > public class A

Re: Policy on commiting unit tests?

2016-01-15 Thread Andy Dufilie
file and method name in the JIRA issue. (if this is Falcon) > > Mike > > On Fri, Jan 15, 2016 at 9:55 AM, Andy Dufilie > wrote: > > > I would like to write some unit tests for issues I know about, but I'm > > unsure how to proceed. Should I commit the unit tes

Policy on commiting unit tests?

2016-01-15 Thread Andy Dufilie
I would like to write some unit tests for issues I know about, but I'm unsure how to proceed. Should I commit the unit tests even if they currently fail? I can create JIRA issues, but I know that unit tests are helpful as well so I would like to know how to contribute those even if I don't curren

Re: [4/5] git commit: [flex-falcon] [refs/heads/develop] - compiler.jx: added support for functions and variables in packages, and functions and variables after package (similar to internal classes)

2016-01-12 Thread Andy Dufilie
Josh, does this commit resolve https://issues.apache.org/jira/browse/FLEX-35004 ? On Tue, Jan 12, 2016 at 11:24 AM, Alex Harui wrote: > I haven't done thorough research, but I think this change is causing the > last remaining failure in the Falcon build. The failing case is > org.apache.flex.co

Re: git commit: [flex-sdk] [refs/heads/develop] - fixed warning

2016-01-11 Thread Andy Dufilie
http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/991f2c29 > > > > Branch: refs/heads/develop > > Commit: 991f2c294422da189c0f80f63829623895995da6 > > Parents: 386c8bb > > Aut

Re: [FalconJX] Is it time to delete the FalconJS code?

2016-01-11 Thread Andy Dufilie
Setting a tag seems like the best way. git tag mytagname git push origin mytagname then do whatever you want. On Mon, Jan 11, 2016 at 4:10 PM, OmPrakash Muppirala wrote: > Maybe this will work (based on this stackoverflow answer [1]) > > 1. Move the code to its own branch. > > 2. Then tag th

Re: Installer updated for 4.15

2016-01-11 Thread Andy Dufilie
The installer worked for me on Windows, though it took a long time to download everything. I didn't get any error, but the swfobject url should probably have /{branch}.zip at the end: https://github.com/swfobject/swfobject/archive/master.zip or https://github.com/swfobject/swfobject/archive/2.2.zi

Re: [FALCONJX][FLEXJS] XML handling (was Re: [FlexJS] Back port)

2016-01-10 Thread Andy Dufilie
On Sun, Jan 10, 2016 at 4:53 PM, Harbs wrote: > I’m trying to figure out namespace behavior. > > I’m probably tired, but can someone tell me why the “catalog_item” var in > this test (on line 70) does not get any results? > > https://gist.github.com/Harbs/c24285b3af80eeed251d > I put your code

Re: Welcome Andy Dufilie as Apache Flex Commiter

2016-01-10 Thread Andy Dufilie
; Mike > > On Sun, Jan 10, 2016 at 10:40 AM, Harbs wrote: > > > Welcome Andy! > > > > It great to have you on board! > > > > Harbs > > > > On Jan 10, 2016, at 5:39 PM, Alex Harui wrote: > > > > > Hi folks, > > > > > > The

Re: [FALCONJX][FLEXJS] "as" keyword handling

2016-01-08 Thread Andy Dufilie
I understand what you're trying to do, and I want the same things. The greatest thing about FlexJS is that I am able to easily port my large project (seven years of development work) with minimal change. However, since my project relies heavily on the exact behavior of every AS language feature,

Re: [FALCONJX][FLEXJS] "as" keyword handling

2016-01-08 Thread Andy Dufilie
On Fri, Jan 8, 2016 at 12:53 PM, Alex Harui wrote: > > On 1/8/16, 7:23 AM, "Andy Dufilie" wrote: > > >In all above cases, if Foo is a primitive type, function-style casting can > >never be optimized out because Foo(x) will actually change the type of x. > &g

Re: [FALCONJX][FLEXJS] "as" keyword handling

2016-01-08 Thread Andy Dufilie
On Fri, Jan 8, 2016 at 1:43 AM, Alex Harui wrote: > > But, IMO, for FlexJS, what really matters is what should happen in the JS > output, and the essence of this thread is that in many cases, we can > optimize away the call to Language.as. > > Right now, "function" casting also results in a Lan

Re: [FALCONJX][FLEXJS] "as" keyword handling

2016-01-07 Thread Andy Dufilie
On Thu, Jan 7, 2016 at 10:54 PM, Josh Tynjala wrote: > That's odd. I swear I remember someone from Adobe once explaining that > function-style casting is faster than as-style casting (with the exception > of primitive types that have a top level function that makes function-style > casting imposs

Re: [FALCONJX][FLEXJS] "as" keyword handling

2016-01-07 Thread Andy Dufilie
On Thu, Jan 7, 2016 at 8:32 PM, Alex Harui wrote: > > On 1/7/16, 5:24 PM, "Andy Dufilie" wrote: > >if (obj is Thing1) > >(obj as Thing1).foo(a,b); > >else if (obj is Thing2) > >(obj as Thing2).bar(x,y); > > There are no plans to change "

Re: [FALCONJX][FLEXJS] "as" keyword handling

2016-01-07 Thread Andy Dufilie
On Thu, Jan 7, 2016 at 4:55 PM, Alex Harui wrote: > How many of you use the "as" keyword as part of a test? I have a huge code base and I use "as" / "is" everywhere ( https://github.com/WeaveTeam/Weave). My code depends on it behaving the same way it does in ActionScript. IMO, being able to ea

Re: [FlexJS] Extending builtin HTML elements

2016-01-06 Thread Andy Dufilie
button is null because document.createElement("button") is not an instance of MyButton. Is this supposed to work? MyButton.as package { public class MyButton extends HTMLButtonElement { public function MyButton() { super(); this.addEventListener("click", button_clickListener, false); } private fun

Re: [FALCONJX][FLEXJS] XML handling (was Re: [FlexJS] Back port)

2016-01-05 Thread Andy Dufilie
On Tue, Jan 5, 2016 at 9:37 AM, Harbs wrote: > That’s not going to work if you need to implement toXMLString(). > > Imagine an mxml file where all the CDATA becomes escaped text. It’s not > going to work very well… ;-) The same goes for lots of other XML file uses. > > Apparently this recommendat

Re: [FALCONJX][FLEXJS] XML handling (was Re: [FlexJS] Back port)

2016-01-05 Thread Andy Dufilie
On Tue, Jan 5, 2016 at 7:10 AM, Harbs wrote: > I cannot find a recommended way to handle CDATA in the DOM4 spec.[3] > > Does anyone have a recommendation o how to handle this? > In place of a CDATA text section you can just escape the text using xml escaping.

Re: Circular dependencies (was: Re: Closure compiler CompilationLevel)

2016-01-04 Thread Andy Dufilie
On Thu, Dec 31, 2015 at 2:42 AM, Alex Harui wrote: > > On 12/30/15, 10:31 PM, "Andy Dufilie" wrote: > >- When I run flexjs/js/bin/compc I get a bin-release folder with the JS > >output files. I then try to run closure manually on these files, and I > >get &g

Re: [FALCONJX][FLEXJS] XML handling (was Re: [FlexJS] Back port)

2016-01-04 Thread Andy Dufilie
On Mon, Jan 4, 2016 at 11:17 AM, Harbs wrote: > For literals, yes, we’d for the most part just pass the whole thing as a > string to the constructor. The only exception I can think of is bracket > notation: > > var foo:XML = foo; > would have to become: > var foo:XML = new XML(' attr="‘+myAttr+’"

Re: JS.SWC source (was: Re: Closure compiler CompilationLevel)

2016-01-01 Thread Andy Dufilie
On Fri, Jan 1, 2016 at 3:28 AM, Alex Harui wrote: > The externc.createjs.swc target calls another ant script that munges the > externs. You could try doing that temporarily for the externc.js.swc > target. > > Oops, I was looking at the wrong target. I see the externc.js.swc target now - it comp

Re: [FalconJX] Vanilla compiler, all externs parsing and contained in SWC :)

2015-12-31 Thread Andy Dufilie
On Thu, Dec 31, 2015 at 11:31 PM, Andy Dufilie wrote: > I've found this page which explains how to compile newer Java code to run > under earlier versions (write Java 1.7 code, run under 1.6): > > http://javarevisited.blogspot.com/2015/05/fixing-unsupported-majorminor-version

Re: [FalconJX] Vanilla compiler, all externs parsing and contained in SWC :)

2015-12-31 Thread Andy Dufilie
Alex Harui wrote > One thing I’ve hit: FB is apparently stuck using Java 1.6. That’s how > old the version of Eclipse is that it uses. Some of the code you’ve > written uses Java 1.7. Can we change back to Java 1.6 syntax? Really, > only the code paths used by FB seem to need to be in Java 1.6

JS.SWC source (was: Re: Closure compiler CompilationLevel)

2015-12-31 Thread Andy Dufilie
On Thu, Dec 31, 2015 at 5:41 PM, Andy Dufilie wrote: > Now that I can compile with js.swc, I am getting a lot of errors because > the type information for many JS functions is incorrect. For example, it > says Array's sort() is a void function. Where is the source code for js.swc &

Re: Closure compiler CompilationLevel

2015-12-31 Thread Andy Dufilie
On Thu, Dec 31, 2015 at 12:17 PM, Josh Tynjala wrote: > You might try using asjsc instead of mxmlc if you want to compile with > JS.swc. > > - Josh > I had tried that before through Flash Builder but it was giving me an error ("Unsupported major.minor version 51.0"). I looked at it again and fo

Re: Closure compiler CompilationLevel

2015-12-30 Thread Andy Dufilie
On Wed, Dec 30, 2015 at 1:05 PM, Alex Harui wrote: > Try: -js-compiler-option="--compilation_level WHITESPACE_ONLY" That worked after fixing the special characters. Is there a place that options like this are documented? Now that I'm compiling via flexjs/js/bin/mxmlc using the WHITESPACE_ONLY