You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Justin Mclean <ju...@classsoftware.com> on 2017/02/24 02:28:37 UTC

[FlexJS] Uncaught TypeError on component creation

HI,

I’m getting this error:
Uncaught TypeError: this.generateMXMLAttributes is not a function
    at new components.LinkButton (LinkButton.js:42)
    at components.LinkNavigation.set__links (LinkNavigation.js:102)

When creating this component:

<?xml version="1.0"?>
<js:TextButton xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:js="library://ns.apache.org/flexjs/basic">
    <js:style>
        <js:SimpleCSSStyles backgroundColor="transparent" borderStyle="none" />
    </js:style>
</js:TextButton>

In ActionScript like so:
var text:LinkButton = new LinkButton();

I assume this is a bug/something misisng? I tried a couple of work arounds but nothing (nesting in a container for example seem to work)

Thanks,
Justin


Re: [FlexJS] Uncaught TypeError on component creation

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

On 2/23/17, 6:28 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

>HI,
>
>I’m getting this error:
>Uncaught TypeError: this.generateMXMLAttributes is not a function
>    at new components.LinkButton (LinkButton.js:42)
>    at components.LinkNavigation.set__links (LinkNavigation.js:102)
>
>When creating this component:
>
><?xml version="1.0"?>
><js:TextButton xmlns:fx="http://ns.adobe.com/mxml/2009"
>xmlns:js="library://ns.apache.org/flexjs/basic">
>    <js:style>
>        <js:SimpleCSSStyles backgroundColor="transparent"
>borderStyle="none" />
>    </js:style>
></js:TextButton>
>
>In ActionScript like so:
>var text:LinkButton = new LinkButton();
>
>I assume this is a bug/something misisng? I tried a couple of work
>arounds but nothing (nesting in a container for example seem to work)

Most controls do not carry the overhead of being capable of being
subclassed in MXML.  Someone would have to create an MXMLTextButton that
supports the MXML lifecycle so you could use that as the top-tag.  Look
for other components that have a generateMXMLAttributes function for an
example.

Thanks,
-Alex