2 Replies Latest reply on Aug 16, 2011 9:11 AM by Cool Wind

    Dynamic embed images?

    Cool Wind Level 1

      Hi,

       

      Here is one of ways to embed image in Flex:

       

      [Embed (source="img0.jpg")]

      public var Img0:Class;

       

      But I want to embed a bunch of images, is there a syntax like this, or a better coding method?

       

      for (var i:int = 0; i<10; i++) {

          var img:Image = new Image();

          img.source = [Embed('img' + i +'.jpg')];

      }

       

      Thanks for reply.