8 Replies Latest reply on Aug 28, 2008 1:13 AM by almond0517

    Problems defining properties of custom components

    manicati Level 1
      I have created a Flash component for Flex. In the AS3 file I have the following code:
      package {

      import flash.display.*
      import flash.text.*
      import mx.flash.UIMovieClip;
      import flash.net.URLRequest;
      import flash.events.*;

      public class mirrorImageHome extends UIMovieClip
      {

      // Define public setter method.
      [Bindable (event="loadBgImage")]
      public function set bgImage(img:String):void
      {
      this.testTXT.text = img;
      dispatchEvent(new Event("loadBgImage"));
      }
      }
      }

      The component works fine in Flex, but the problem is that it only works when my property is static:


      Works:
      <FlashComps:mirrorImageHome y="150" bgImage="TEST" includeInLayout="false" />


      Does not work:
      <FlashComps:mirrorImageHome y="150" bgImage="{'TEST'}" includeInLayout="false" />

      I know, the curly braces have no effect in this case. It's only to illustrate that the property does not accept dynamic data.

      Did I something wrong with the AS3?

      Can anyone help me, please?