You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Carlos Rovira <ca...@apache.org> on 2017/02/24 11:03:32 UTC

[FlexJS][SpriteFlexJS][Maven] Trying to write some example with FlexJS and SpriteFlexJS

Hi,

I created a test project with FlexJS and SpriteFlexJS. I use MDL for
structure the example equally as I did before with MDLExample.

It's here: https://github.com/carlosrovira/sprite-flexjs-examples

So, the first thing I'm trying is this example by Lizhi:
https://codepen.io/matrix3d/pen/mAZmVy

But I found the following problems:

1.- If I remove in pom.xml (
https://github.com/carlosrovira/sprite-flexjs-examples/blob/master/pom.xml)
the spriteflexjs maven dependency (line 81 to 86), the project still build
successfully

2.- Although build succeed, at runtime I find errors:

   a) In. SpriteFlexjsMain.base.js. ---->.
goog.inherits(SpriteFlexjsMain, flash.display.Sprite);
<--  ReferenceError: Can't find variable: flash


   b) In EventDispatcher.js.    --------->          TypeError:
SpriteFlexjsMain.base is not a function. (In 'SpriteFlexjsMain.base(this,
'constructor')', 'SpriteFlexjsMain.base' is undefined)



One thing that could be happen is that projects are outside the flex-asjs
folder umbrella. Could this be making some troubles and make the
spritelfexjs maven artifact not recognized by the sample project?


Further problems will be: If I get compilation ok, is that I think I will
need to do some "addChild()" or "addElement()" in mxml in order to display
the example on screen. Right now the object is created, but not added to
display list.
How this could be done in FlexJS?





-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [FlexJS][SpriteFlexJS][Maven] Trying to write some example with FlexJS and SpriteFlexJS

Posted by Alex Harui <ah...@adobe.com>.

On 2/25/17, 9:10 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:

>>
>>    a) In. SpriteFlexjsMain.base.js. ---->.
>>goog.inherits(SpriteFlexjsMain,
>> flash.display.Sprite);                   <--  ReferenceError: Can't find
>> variable: flash
>>
>>
>>    b) In EventDispatcher.js.    --------->          TypeError:
>> SpriteFlexjsMain.base is not a function. (In
>>'SpriteFlexjsMain.base(this,
>> 'constructor')', 'SpriteFlexjsMain.base' is undefined)
>>
>>
>>
>> One thing that could be happen is that projects are outside the
>>flex-asjs
>> folder umbrella. Could this be making some troubles and make the
>> spritelfexjs maven artifact not recognized by the sample project?

It isn't whether a bunch of code is outside of flex-asjs folder, it is
whether that code is using goog.require or not.  So look at
flash.display.Sprite.js and see if it is or not.  If it is, then the issue
may be whether flash.display.Sprite.js is in the SWCs or specified via
-sdk-js-lib.  If it isn't, then it may not be usable as a base class in
FlexJS.  I think Google Closure expects goog.require.

>>
>>
>> Further problems will be: If I get compilation ok, is that I think I
>>will
>> need to do some "addChild()" or "addElement()" in mxml in order to
>>display
>> the example on screen. Right now the object is created, but not added to
>> display list.
>> How this could be done in FlexJS?

Components have to be made into MXML-ready components to be used as the
top tag in MXML.  Look for components in flex-asjs that have a
generateMXMLAttributes method.

Components can be child tags in MXML without as much overhead, but I think
we currently require children to implement IUIBase.

HTH,
-Alex


Re: [FlexJS][SpriteFlexJS][Maven] Trying to write some example with FlexJS and SpriteFlexJS

Posted by Carlos Rovira <ca...@apache.org>.
Hi, could someone take a look to this?
thanks

2017-02-24 12:03 GMT+01:00 Carlos Rovira <ca...@apache.org>:

> Hi,
>
> I created a test project with FlexJS and SpriteFlexJS. I use MDL for
> structure the example equally as I did before with MDLExample.
>
> It's here: https://github.com/carlosrovira/sprite-flexjs-examples
>
> So, the first thing I'm trying is this example by Lizhi:
> https://codepen.io/matrix3d/pen/mAZmVy
>
> But I found the following problems:
>
> 1.- If I remove in pom.xml (https://github.com/carlosrovira/sprite-flexjs-
> examples/blob/master/pom.xml) the spriteflexjs maven dependency (line 81
> to 86), the project still build successfully
>
> 2.- Although build succeed, at runtime I find errors:
>
>    a) In. SpriteFlexjsMain.base.js. ---->.         goog.inherits(SpriteFlexjsMain,
> flash.display.Sprite);                   <--  ReferenceError: Can't find
> variable: flash
>
>
>    b) In EventDispatcher.js.    --------->          TypeError:
> SpriteFlexjsMain.base is not a function. (In 'SpriteFlexjsMain.base(this,
> 'constructor')', 'SpriteFlexjsMain.base' is undefined)
>
>
>
> One thing that could be happen is that projects are outside the flex-asjs
> folder umbrella. Could this be making some troubles and make the
> spritelfexjs maven artifact not recognized by the sample project?
>
>
> Further problems will be: If I get compilation ok, is that I think I will
> need to do some "addChild()" or "addElement()" in mxml in order to display
> the example on screen. Right now the object is created, but not added to
> display list.
> How this could be done in FlexJS?
>
>
>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira