I gave everything a $displayObject property which is an alias to the specific 
DisplayObject type. There’s also $sprite $textField $shape and $button for the 
specific types.

I did this to avoid having to do casting all over the place.

I did not use element because it was a IFlexJSElement and Flash doesn’t know 
what to do with that.

On Jul 29, 2016, at 1:46 AM, Alex Harui <aha...@adobe.com> wrote:

> 
> 
> On 7/28/16, 2:55 PM, "Harbs" <harbs.li...@gmail.com> wrote:
> 
>> It should be creating it in the constructor. Is there a problem with
>> doing it like that?
> 
> Not sure.  I thought you were going to re-purpose the 'element' property
> from the JS side.  Is there a reason you didn't do that?  I think assuming
> a Sprite is not correct for simple components that don't have children
> like Button.  IMO, no need to wrap Buttons inside Sprites.
> 
> Thoughts?
> -Alex
> 
>> 
>> On Jul 28, 2016, at 11:51 PM, Alex Harui <aha...@adobe.com> wrote:
>> 
>>> Harbs,
>>> 
>>> I've started poking around in this branch.  How is the SWF version
>>> supposed to create the wrapped element?  I would've expected
>>> createElement
>>> to be used?  Or is it somewhere else?
>>> 
>>> -Alex
>>> 
>>> On 7/28/16, 11:43 AM, "Alex Harui" <aha...@adobe.com> wrote:
>>> 
>>>> 
>>>> 
>>>> On 7/27/16, 1:41 PM, "Alex Harui" <aha...@adobe.com> wrote:
>>>> 
>>>>> 
>>>>> 
>>>>> On 7/27/16, 1:27 PM, "Harbs" <harbs.li...@gmail.com> wrote:
>>>>>>>> The only class which still subclasses Sprite is Application. I
>>>>>>>> don’t
>>>>>>>> know
>>>>>>>> a way around that.
>>>>>>> 
>>>>>>> One idea is that, since developer code never instantiates an
>>>>>>> Application
>>>>>>> (only the framework does) that Application could be an interface.
>>>>>>> The
>>>>>>> framework would instantiate the concrete class.
>>>>>> 
>>>>>> Not sure how to go about this, but I’m not sure how bad it is for the
>>>>>> main app to subclass Sprite. I’ll leave this for someone else.
>>>>> 
>>>>> If we don't fix this, the Application code-hinting will show all the
>>>>> Flash
>>>>> stuff.
>>>> 
>>>> Thinking about it more, Application can't be an interface since it is
>>>> used
>>>> in MXML.  I will try to use [FactoryClass] and have the factory wrap
>>>> itself with Application.  I think right now that will add a
>>>> "first-frame"
>>>> to the SWF which FlexJS doesn't have right now (but Flex does).
>>>> Anybody
>>>> think that's a bad idea?
>>>> 
>>>> -Alex
>>>> 
>>> 
>> 
> 

Reply via email to