Re: [FlexJS] subclassed Flash classes and casting

2016-07-12 Thread Alex Harui
On 7/12/16, 7:55 AM, "Harbs" wrote: >I’ll respond inline although it’ll likely start to get cumbersome. > >On Jul 12, 2016, at 5:33 PM, Alex Harui wrote: > >> >> >> On 7/12/16, 1:29 AM, "Harbs" wrote: >> >>> I did not think about Application. That does put a spanner in the >>>works,

Re: [FlexJS] subclassed Flash classes and casting

2016-07-12 Thread Harbs
I’ll respond inline although it’ll likely start to get cumbersome. On Jul 12, 2016, at 5:33 PM, Alex Harui wrote: > > > On 7/12/16, 1:29 AM, "Harbs" wrote: > >> I did not think about Application. That does put a spanner in the works, >> but composition might make sense anyway and prox

Re: [FlexJS] subclassed Flash classes and casting

2016-07-12 Thread Alex Harui
On 7/12/16, 1:29 AM, "Harbs" wrote: >I did not think about Application. That does put a spanner in the works, >but composition might make sense anyway and proxy everything. It’ll >probably be a lot of work, and there’s probably other things to worry >about first. > >HTML needs to be br

Re: [FlexJS] subclassed Flash classes and casting

2016-07-12 Thread Harbs
Here’s a good article on transforms (and differences with different methods) https://css-tricks.com/transforms-on-svg-elements/ On Jul 12, 2016, at 11:29 AM, Harbs wrote: > I did not think about Application. That does put a spanner in the works, but > composition might make sense anyway and pr

Re: [FlexJS] subclassed Flash classes and casting

2016-07-12 Thread Harbs
I did not think about Application. That does put a spanner in the works, but composition might make sense anyway and proxy everything. It’ll probably be a lot of work, and there’s probably other things to worry about first. HTML needs to be broken down into 3 categories: Normal DOM elements, SV

Re: [FlexJS] subclassed Flash classes and casting

2016-07-11 Thread Alex Harui
On 7/11/16, 12:23 AM, "Harbs" wrote: >It could be that instead of subclassing Flash objects, we should be using >composition instead… Maybe. I started out subclassing because it would be lower overhead, and so the main class could be the initial class in the SWF. I think the initial entry po

Re: [FlexJS] subclassed Flash classes and casting

2016-07-11 Thread Harbs
It could be that instead of subclassing Flash objects, we should be using composition instead… On Jul 11, 2016, at 10:21 AM, Harbs wrote: > Sure they are. > > Try this: > var myRect:org.apache.flex.core.graphics.Rect = new > org.apache.flex.core.graphics.Rect(); > var transform:Matrix = myRec

Re: [FlexJS] subclassed Flash classes and casting

2016-07-11 Thread Harbs
Sure they are. Try this: var myRect:org.apache.flex.core.graphics.Rect = new org.apache.flex.core.graphics.Rect(); var transform:Matrix = myRect.transform; On Jul 11, 2016, at 10:16 AM, Alex Harui wrote: > > > On 7/11/16, 12:06 AM, "Harbs" wrote: > >> I believe Bitmaps use Rectangles. > >

Re: [FlexJS] subclassed Flash classes and casting

2016-07-11 Thread Alex Harui
On 7/11/16, 12:06 AM, "Harbs" wrote: >I believe Bitmaps use Rectangles. OK but flash.display.Bitmap should not be exposed to the SWC's API surface. Bitmap should be wrapped and rectangles in its API should be wrapped as well. > >FlexJS subclasses DisplayObject which returns a Flash Matrix fo

Re: [FlexJS] subclassed Flash classes and casting

2016-07-11 Thread Harbs
I believe Bitmaps use Rectangles. FlexJS subclasses DisplayObject which returns a Flash Matrix for the transform. IF you try to use transformPoint() on that, it’ll return (and expects) a Flash Point. I’m sure there’s more examples. On Jul 11, 2016, at 10:03 AM, Alex Harui wrote: > > > On 7

Re: [FlexJS] subclassed Flash classes and casting

2016-07-11 Thread Alex Harui
On 7/10/16, 11:59 PM, "Harbs" wrote: >One simple example is clone() on on both Point and Rectangle. Flash >returns a flash Rectangle, but Flex is expecting a flex Rectangle. >Another one that I ran into in my own code is union() in Rectangle. > >The casting that I did, did not even work. The co

Re: [FlexJS] subclassed Flash classes and casting

2016-07-10 Thread Harbs
One simple example is clone() on on both Point and Rectangle. Flash returns a flash Rectangle, but Flex is expecting a flex Rectangle. Another one that I ran into in my own code is union() in Rectangle. The casting that I did, did not even work. The compiler does not complain if you change the

Re: [FlexJS] subclassed Flash classes and casting

2016-07-10 Thread Alex Harui
On 7/10/16, 10:37 PM, "Harbs" wrote: >I believe the reason it’s subclassing flash.geom.Rectangle is because >some Flash classes return Rectangles and those cases need to be handled. > >I’m not sure how the static methods would work and resolving to flash >packages should only happen on the SWF

Re: [FlexJS] subclassed Flash classes and casting

2016-07-10 Thread Harbs
I believe the reason it’s subclassing flash.geom.Rectangle is because some Flash classes return Rectangles and those cases need to be handled. I’m not sure how the static methods would work and resolving to flash packages should only happen on the SWF side. On Jul 11, 2016, at 8:18 AM, Alex Har

Re: [FlexJS] subclassed Flash classes and casting

2016-07-10 Thread Alex Harui
On 7/10/16, 1:32 PM, "Harbs" wrote: >I just added some casting to Point, Rectangle and Matrix. The reason for >this is that Flex objects are expecting org.apache.flex.geom instead of >flash.geom classes. Any objects originating from Flash causes compiler >errors on the Flex side. > >I’m sure th