1 Reply Latest reply on Nov 21, 2009 8:48 AM by harihisu

    Issues with Embed tag ..


      Hi.I have the problem with the embed tag.


      When I try to do this


      var EmbedPic:Class;
      It works fine.


      But when I try this


      var str:String="images/21.jpg"
      var EmbedPic:Class;


      It doesn't work.


      So how can I be able to embed the images whose path are coming at runtime from a variable .
      Or any other solution for embedding an images directly in flash whose paths are coming from xml.



        • 1. Re: Issues with Embed tag ..
          harihisu Level 2

          When using [Embed] metadata tag, the picture will be embedded into your swf at compile time, not runtime.

          To load a picture at runtime, create an Image instance and load the corressponding URL


          var img:Image = new Image();
          img.load( "images/21.jpg" );