2 Replies Latest reply on Aug 23, 2006 11:32 AM by Newsgroup_User

    Syntax for embeding data bound values

    Level 7
      This does not work:

      source="@Embed(source='{sourceFile}'))" autoLoad="true"/>
      <mx:String id="sourceFile">file:///C|/FlexWork/flex
      maps/assets/products/Talby.png</mx:String>


      nor does simply @Embed({sourceFile})

      So what does work?



        • 1. Re: Syntax for embeding data bound values
          Level 7
          Also @Embed(source="{sourceFile}) does not work.

          BTW, can one Embed an XML file

          <mx:XML source={whatever} />


          "Yechezkal Gutfreund" <sgutfreund@hotmail.com> wrote in message
          news:eci6o0$juc$1@forums.macromedia.com...
          > This does not work:
          >
          > source="@Embed(source='{sourceFile}'))" autoLoad="true"/>
          > <mx:String id="sourceFile">file:///C|/FlexWork/flex
          > maps/assets/products/Talby.png</mx:String>
          >
          >
          > nor does simply @Embed({sourceFile})
          >
          > So what does work?
          >
          >
          >


          • 2. Re: Syntax for embeding data bound values
            peterent Level 2
            That won't work because the @Embed syntax is compile-time while the data binding, { }, syntax is runtime. You are combing the two.

            If you think you are going to change or set the value of the image file at runtime (which is what it appears you are doing), then you cannot embed the image.

            Instead do:

            source="{sourceFile}"

            and then it will load whatever image sourceFile points to at runtime.