Re: [FlexJS] Confusion about compilaton
In my changes yesterday, I think what I did was move the compile-js mojo to the compile phase along with the compile-as and compile-extern mojo. All three compiles are needed to build SWCs, but only two are needed to build an example/app. There is no need for a compile-extern. Does compile-extern get skipped when building an app/example? Otherwise it might report errors that don't matter. In addition, the compiler cares about different kinds of compilation units. It transpiles MXML and AS compilation units but not SWCCompilationUnits. This enables the app developer to specify the same library-path of SWCs for both the SWF and JS outputs. The SWCs contain both ABC code for SWFs and transpiled JS classes. The MXML and AS compilation units are transpiled and combined with the .js files from the SWCs to create the final output set. If you have source for a SWC in your source-path, you are replacing a SWCComplationUnit with an ASCompilationUnit and the source gets transpiled with whatever app compile settings are in effect instead of what settings were used in the SWC. That's a way to monkey-patch, but can result in surprises. I don't think that's the case here since the app compiles generally don't specify COMPILE::SWF or COMPILE::JS and thus you'd get a different error about missing conditional compile flags. When building the SWCs, the compile-externs mojo is supposed to be handed other externs/typedefs SWCs as upstream SWCs which have been compiled with COMPILE::JS=true. If in an app compilation, the compile-externs phase is picking up the SWCs that were compiled with COMPILE::SWF=true, then I guess you might run into something like you are reporting. HTH, -Alex On 10/5/16, 6:55 AM, "Christofer Dutz" wrote: >Hi, > > >I am currently digging though some things Carlos recent posts made me >aware of. Especially his comment about the maven build double compiling >stuff. I did stumble over something while setting up a first pure-js >testsuite test. > > >In this module I want to create the JS version of the HelloWorld project. >I was confused, why it wanted me to provide the >flash.display.DisplayObject ... so I added playerglobal and the project >built just fine (the same way the application archetype is). The output >worked in Flash and in JavaScript. But I thought "Hey ... it's pure JS so >why do I need playerglobal?". If I omit the playerglobal, the JS Compiler >complains about MXMLDataInterpreter missing the definition of >flash.display.DisplayObject. Having a short look at the class definition >this is clearly inside a "COMPILE::SWF" block. Which makes sense as this >is the way the SWC was compiled. But how should I compile the core >modules in order to use them in a pure JS compilation? Wouldn't I need >all the classes in a version compiled with "COMPILE:JS" set to True? > > >But why do all the examples work? The code should be invalid as it's the >SWC code variant that seems to be used. Or is it that the Flash code >contains the "SWC" version and the "js/out" contains the "JS" version? >Then I still don't understand why my examples are running nicely the way >they are currently. > > >Chris
AW: [FlexJS] Confusion about compilaton
And what's even stranger, but I forgot to mention in my last post. The compiler produces the JS debug version correctly and it seems to be runnable, but as the compiler returns a set of problems, the build fails. Chris Von: Christofer Dutz Gesendet: Mittwoch, 5. Oktober 2016 15:55:00 An: dev@flex.apache.org Betreff: [FlexJS] Confusion about compilaton Hi, I am currently digging though some things Carlos recent posts made me aware of. Especially his comment about the maven build double compiling stuff. I did stumble over something while setting up a first pure-js testsuite test. In this module I want to create the JS version of the HelloWorld project. I was confused, why it wanted me to provide the flash.display.DisplayObject ... so I added playerglobal and the project built just fine (the same way the application archetype is). The output worked in Flash and in JavaScript. But I thought "Hey ... it's pure JS so why do I need playerglobal?". If I omit the playerglobal, the JS Compiler complains about MXMLDataInterpreter missing the definition of flash.display.DisplayObject. Having a short look at the class definition this is clearly inside a "COMPILE::SWF" block. Which makes sense as this is the way the SWC was compiled. But how should I compile the core modules in order to use them in a pure JS compilation? Wouldn't I need all the classes in a version compiled with "COMPILE:JS" set to True? But why do all the examples work? The code should be invalid as it's the SWC code variant that seems to be used. Or is it that the Flash code contains the "SWC" version and the "js/out" contains the "JS" version? Then I still don't understand why my examples are running nicely the way they are currently. Chris
[FlexJS] Confusion about compilaton
Hi, I am currently digging though some things Carlos recent posts made me aware of. Especially his comment about the maven build double compiling stuff. I did stumble over something while setting up a first pure-js testsuite test. In this module I want to create the JS version of the HelloWorld project. I was confused, why it wanted me to provide the flash.display.DisplayObject ... so I added playerglobal and the project built just fine (the same way the application archetype is). The output worked in Flash and in JavaScript. But I thought "Hey ... it's pure JS so why do I need playerglobal?". If I omit the playerglobal, the JS Compiler complains about MXMLDataInterpreter missing the definition of flash.display.DisplayObject. Having a short look at the class definition this is clearly inside a "COMPILE::SWF" block. Which makes sense as this is the way the SWC was compiled. But how should I compile the core modules in order to use them in a pure JS compilation? Wouldn't I need all the classes in a version compiled with "COMPILE:JS" set to True? But why do all the examples work? The code should be invalid as it's the SWC code variant that seems to be used. Or is it that the Flash code contains the "SWC" version and the "js/out" contains the "JS" version? Then I still don't understand why my examples are running nicely the way they are currently. Chris
Re: FlexJS Confusion
Might be you need to fully qualify RadioButton On 5/7/13 10:01 AM, "Peter Ent" wrote: > As a matter of fact, it does. Well, its super-class does. > > org.apache.flex.jquery.staticControls.RadioButton extends > org.apache.flex.html.staticControls.RadioButton which has initModel. I'll > try adding it to the jQuery version and have it call the super method. > > -peter > > On 5/7/13 11:26 AM, "Alex Harui" wrote: > >> Does your RadioButton have a method called initModel? The base classes >> don't implement it by default. >> >> >> On 5/7/13 7:38 AM, "Peter Ent" wrote: >> >>> I'm trying to programmatically create a RadioButton to test and create a >>> jQuery version. My ActionScript code works well: >>> >>> >>> public function createNewRadioButton() : void >>> >>> { >>> >>> var rb:RadioButton = new RadioButton(); >>> >>> rb.initModel(); >>> >>> rb.initSkin(); >>> >>> rb.text = "New Radio"; >>> >>> rb.groupName = "group1"; >>> >>> rb.x = radioXpos; >>> >>> rb.y = 290; >>> >>> rb.value = radioXpos; >>> >>> this.addChild(rb); >>> >>> radioXpos += 100; >>> >>> } >>> >>> However, after compiling with Falcon JX and running the Javascript >>> version, >>> this code causes the browser to complain "TypeError: rb.initModel is >>> not a >>> function". I guess I'm confused about how to bring the model from >>> ActionScript >>> over to Javascript. Since normal HTML elements do >>> not >>> require group management (on our part), I didn't need anything like >>> that when >>> I created the HTML RadioButton, but even without thinking about jQuery, >>> programmatically creating a RadioButton requires - I think - using >>> rb.initModel(). >>> >>> --peter >> >> -- >> Alex Harui >> Flex SDK Team >> Adobe Systems, Inc. >> http://blogs.adobe.com/aharui >> > -- Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui
Re: FlexJS Confusion
As a matter of fact, it does. Well, its super-class does. org.apache.flex.jquery.staticControls.RadioButton extends org.apache.flex.html.staticControls.RadioButton which has initModel. I'll try adding it to the jQuery version and have it call the super method. -peter On 5/7/13 11:26 AM, "Alex Harui" wrote: >Does your RadioButton have a method called initModel? The base classes >don't implement it by default. > > >On 5/7/13 7:38 AM, "Peter Ent" wrote: > >> I'm trying to programmatically create a RadioButton to test and create a >> jQuery version. My ActionScript code works well: >> >> >> public function createNewRadioButton() : void >> >> { >> >> var rb:RadioButton = new RadioButton(); >> >> rb.initModel(); >> >> rb.initSkin(); >> >> rb.text = "New Radio"; >> >> rb.groupName = "group1"; >> >> rb.x = radioXpos; >> >> rb.y = 290; >> >> rb.value = radioXpos; >> >> this.addChild(rb); >> >> radioXpos += 100; >> >> } >> >> However, after compiling with Falcon JX and running the Javascript >>version, >> this code causes the browser to complain "TypeError: rb.initModel is >>not a >> function". I guess I'm confused about how to bring the model from >>ActionScript >> over to Javascript. Since normal HTML elements do >>not >> require group management (on our part), I didn't need anything like >>that when >> I created the HTML RadioButton, but even without thinking about jQuery, >> programmatically creating a RadioButton requires - I think - using >> rb.initModel(). >> >> --peter > >-- >Alex Harui >Flex SDK Team >Adobe Systems, Inc. >http://blogs.adobe.com/aharui >
Re: FlexJS Confusion
Does your RadioButton have a method called initModel? The base classes don't implement it by default. On 5/7/13 7:38 AM, "Peter Ent" wrote: > I'm trying to programmatically create a RadioButton to test and create a > jQuery version. My ActionScript code works well: > > > public function createNewRadioButton() : void > > { > > var rb:RadioButton = new RadioButton(); > > rb.initModel(); > > rb.initSkin(); > > rb.text = "New Radio"; > > rb.groupName = "group1"; > > rb.x = radioXpos; > > rb.y = 290; > > rb.value = radioXpos; > > this.addChild(rb); > > radioXpos += 100; > > } > > However, after compiling with Falcon JX and running the Javascript version, > this code causes the browser to complain "TypeError: rb.initModel is not a > function". I guess I'm confused about how to bring the model from ActionScript > over to Javascript. Since normal HTML elements do not > require group management (on our part), I didn't need anything like that when > I created the HTML RadioButton, but even without thinking about jQuery, > programmatically creating a RadioButton requires - I think - using > rb.initModel(). > > --peter -- Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui
FlexJS Confusion
I'm trying to programmatically create a RadioButton to test and create a jQuery version. My ActionScript code works well: public function createNewRadioButton() : void { var rb:RadioButton = new RadioButton(); rb.initModel(); rb.initSkin(); rb.text = "New Radio"; rb.groupName = "group1"; rb.x = radioXpos; rb.y = 290; rb.value = radioXpos; this.addChild(rb); radioXpos += 100; } However, after compiling with Falcon JX and running the Javascript version, this code causes the browser to complain "TypeError: rb.initModel is not a function". I guess I'm confused about how to bring the model from ActionScript over to Javascript. Since normal HTML elements do not require group management (on our part), I didn't need anything like that when I created the HTML RadioButton, but even without thinking about jQuery, programmatically creating a RadioButton requires - I think - using rb.initModel(). --peter