I'm using Flex 4 and Flash Builder 4. I just want to learn to create components and I created an mxml component as follows and included it in my application:
<?xml version="1.0" encoding="utf-8"?>
<s:TextInput xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
</fx:Script>
</s:TextInput>
If I take out the fx:Script tags it works, but as soon as I have those tags (regardless of whether any actual code is in there) I get the error: "Flex custom component doesn't accept script: Multiple initializer values for default property, 'text', of type 'String'."
Why would that be? Is script not allowed in components?
this is a known bug SDK-25184. Milestone is the next Flex SDK Hero Release. You still can use mxml if you explicitly set the text property.
<?xml version="1.0" encoding="utf-8"?>
<s:TextInput xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
text="">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:TextInput>
Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With