Re: [FlexJS] Extending builtin HTML elements

2016-01-07 Thread OmPrakash Muppirala
On Wed, Jan 6, 2016 at 11:57 PM, Alex Harui wrote: > > > On 1/6/16, 11:36 PM, "omup...@gmail.com on behalf of OmPrakash Muppirala" > wrote: > > >> > >> Add the following as the ASDoc for the WebProject1() method, then it >

Re: [FlexJS] Extending builtin HTML elements

2016-01-06 Thread Alex Harui
On 1/6/16, 6:35 PM, "Andy Dufilie" wrote: >button is null because document.createElement("button") is not an instance >of MyButton. Andy is right. We have not tried to extend the type system into the built-in classes. Not sure we could guarantee that would work. More

[FlexJS] Extending builtin HTML elements

2016-01-06 Thread OmPrakash Muppirala
Is this supposed to work? MyButton.as package { public class MyButton extends HTMLButtonElement { public function MyButton() { super(); this.addEventListener("click", button_clickListener, false); } private function button_clickListener(event : MouseEvent) : void { alert("Hello World"); } } }

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

Re: [FlexJS] Extending builtin HTML elements

2016-01-06 Thread OmPrakash Muppirala
On Wed, Jan 6, 2016 at 8:54 PM, Alex Harui wrote: > On 1/6/16, 6:35 PM, "Andy Dufilie" wrote: > > >button is null because document.createElement("button") is not an instance > >of MyButton. > > Andy is right. We have not tried to extend the type system

Re: [FlexJS] Extending builtin HTML elements

2016-01-06 Thread Alex Harui
On 1/6/16, 11:36 PM, "omup...@gmail.com on behalf of OmPrakash Muppirala" wrote: >> >> Add the following as the ASDoc for the WebProject1() method, then it >> should work: >> >> /** >> * @flexjsignorecoercion MyButton >> */ >> >public