1 Reply Latest reply on Dec 9, 2009 10:09 PM by Shivik

    Embedding icons/images in SWF

    Shivik Level 1

      Hello all

       

      i am trying to embed some icons and images in my swf. I have tried using the @Embed directive everywhere - in my locale, in actionscript as a bindable class, in the source/icon properties, but nothing works. When I compile the application on command line, it always displays

       

      Error: unable to resolve 'assets-embed/icons/icon-mail.png' for transcoding
      Error: unable to transcode assets-embed/icons/icon-mail.png
      

       

      Here is my project structure

       

      project

           bin

                Main.swf

           src

                assets-embed

                     icons

                          icon-mail.png

                views

                     header

                          Header.mxml (I am trying to embed the icon in this file)

      Main.mxml (header component lies here)

       

      I have tried doing these, but all in vain.

       

      <mx:LinkButton id="link" label="hello" icon="Embed( 'assets-embed/icons/icon-mail.png' )" />

       

      <mx:LinkButton id="link" label="hello" icon="@Embed( 'assets-embed/icons/icon-mail.png' )" />

       

      <mx:LinkButton id="link" label="hello" icon="Embed(source= 'assets-embed/icons/icon-mail.png' )" />

       

      <mx:LinkButton id="link" label="hello" icon="@Embed(source= 'assets-embed/icons/icon-mail.png' )" />

       

      in actionscript Script tag

      [Embed(source='assets-embed/icons/icon-mail.png')]

      [Bindable]

      public var imgCls:Class;

       

      <mx:LinkButton id="link" label="hello" icon="{imgCls}" />

       

       

      What am I doing wrong over here? Please help me out.

       

      Thanks and Regards

      ShiVik