0 Replies Latest reply on Apr 26, 2012 5:07 AM by enPerdition

    Create swf skin with assets




      is it possible to create a skin in a swf which contains assets (images) ?


      I have a skin class :



      <?xml version="1.0" encoding="utf-8"?>
      <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
                  public var img:Class;
          <s:Label id="label" text="skinYellow" />
          <s:Image source="{img}" />



      and a css file :


      /* CSS file */
      @namespace s "library://ns.adobe.com/flex/spark";
      @namespace mx "library://ns.adobe.com/flex/mx";
      @namespace test "com.test.*";
          skinClass: ClassReference("skins.yellow.BoutonPersoSkinYellow");
      test|BoutonPerso #label {
          color: "0xFFFF00";


      when I launch this command :



      mxmlc myCSSFile.css


      there is no error and my SWF contains my url2.png image but when I try to use this skin at runtime in my main application with styleManager.loadStyleDeclarations2() I received an error :



      Error: Skin for skinsRuntimeBase0.ApplicationSkin2._ApplicationSkin_Group1.contentGroup.BoutonPerso9.BoutonPersoSkinYellow19._BoutonPersoSkinYellow_Image1 cannot be found.



      My url2.png image doesn't seem to be found but it's in the skin swf...



      How can I solve this problem please ?


      Thank you