You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Olaf Krueger <ma...@olafkrueger.net> on 2019/02/25 12:33:38 UTC

TypeError: this.generateMXMLAttributes is not a function

Hi,
I am trying to create a custom component which should just wrap a Royale
component.
As soon as I set a property via MXML, I got a TypeError [1].

I this case it's a Jewel button, but I got the same error with a TextButton
when setting the "text" property.

This is a screenshot of the entire scenario [2].

Couldn't we use MXML properties that way?

Thanks,
Olaf

[1] TypeError: this.generateMXMLAttributes is not a function
[2] https://snag.gy/4XcBhf.jpg





--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: TypeError: this.generateMXMLAttributes is not a function

Posted by Carlos Rovira <ca...@apache.org>.
El lun., 25 feb. 2019 a las 13:52, Harbs (<ha...@gmail.com>) escribió:

>
>
> P.S. I would advocate for a compiler error when using a class which
> doesn’t impelement IMXMLDocument as a base for MXML.
>
>
I think that's a good idea too!



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

Re: TypeError: this.generateMXMLAttributes is not a function

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Understand, thanks for the explanation Harbs!

Olaf



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: TypeError: this.generateMXMLAttributes is not a function

Posted by Harbs <ha...@gmail.com>.
In Royale, only components which implement IMXMLDocument can be used as a base class for an MXML file. If this is something you are looking to do a lot, you have two options:
1. Subclass the components and implement IMXMLDocument.
2. Use an ActionScript class instead of an MXML file.

For things like this, I tend to use AS files anyway because they are lighter.

HTH,
Harbs

P.S. I would advocate for a compiler error when using a class which doesn’t impelement IMXMLDocument as a base for MXML.

> On Feb 25, 2019, at 2:33 PM, Olaf Krueger <ma...@olafkrueger.net> wrote:
> 
> Hi,
> I am trying to create a custom component which should just wrap a Royale
> component.
> As soon as I set a property via MXML, I got a TypeError [1].
> 
> I this case it's a Jewel button, but I got the same error with a TextButton
> when setting the "text" property.
> 
> This is a screenshot of the entire scenario [2].
> 
> Couldn't we use MXML properties that way?
> 
> Thanks,
> Olaf
> 
> [1] TypeError: this.generateMXMLAttributes is not a function
> [2] https://snag.gy/4XcBhf.jpg
> 
> 
> 
> 
> 
> --
> Sent from: http://apache-royale-development.20373.n8.nabble.com/