1 Reply Latest reply on Nov 12, 2008 2:00 PM by Mr Riney

    Custom Components and Properties in Flex Builder Design View

      How do I create a custom component with custom properties that renders well in Flex Builder design view?

      This is a simple HelloWorld example of what I am trying below. Here is the HelloWorld.mxml file:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="500" height="500">
      <mx:Script><![CDATA[
      [Bindable]
      public var message:String;
      ]]></mx:Script>
      <mx:Label x="100" y="100" text="{message}" />
      </mx:Canvas>

      And then when I use it in another mxml file, the design view does not show the label with the 'Hello World' value - instead it just shows {message} in design view where the label is located. When I run it as a compiled app in flash, the 'Hello World' is displayed correctly:
      -- HelloWorldTest.mxml --
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns:views="mypackage.*" width="500" height="500">
      <views:SimpleLine message="Hello World."/>
      </mx:Canvas>