Initializer for ‘defaultButton’: values of type mx.core.IFlexDisplayObject cannot be represented in text

Error:
Initializer for ‘defaultButton’: values of type mx.core.IFlexDisplayObject cannot be represented in text.

The property defaultButton of the Form element was expecting something other than a string. Here is the original source code:


And the correct source code:


Notice the curly brackets get the actual object as it would if it were inside ActionScript (that is because it actually is -ed.).

Please reply in the comments below if this helped you or not

This entry was posted in Flex. Bookmark the permalink.

5 Responses to Initializer for ‘defaultButton’: values of type mx.core.IFlexDisplayObject cannot be represented in text

  1. masu says:

    Hi, I have the same problem. Could you please show the code somewhere? Regards, masu

  2. Judah says:

    My bad. I had not enclosed the code in code tags. You should be able to see it now.

  3. Daniela says:

    Thanks! I’ve been scratching my head so bad for this problem. Still getting the hang of MXML, sometimes is hard to get. :)

  4. JabbyPanda says:

    I got the same error when I wrongly closed XML tag in MXML too soon:

    Wrong code:
    —————-
    <presentation:CompanyUnits id=”companyUnits”>
    width=”200″
    height=”100%”
    title=”Company units”

    Correct code:
    —————-
    <presentation:CompanyUnits id=”companyUnits”
    width=”200″
    height=”100%”
    title=”Company units”>

  5. RYAN says:

    Thanks man!

Leave a Reply

Your email address will not be published. Required fields are marked *

Wrap your code before posting! Click the links below:

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="">