tags:

views:

89

answers:

0

I can upload image but the sprite name remains pict1 each time I upload another image. Why doesn't imgVal function increase?

             function imgVal() 
  { 
   img += 1; 
   trace("image: pict" + img);
  }

  imgVal();
  _fla.lights_mc.visible=false;
  _fla.lights_mc.stop();
  _fla.pre_mc.fill_mc.stop();
  _fla.pre_mc.visible=false;

  var sprite:Sprite=new Sprite();
  sprite.addChild(loader);
  sprite.name = "pict" + img;

  //trace(sprite.name);
  _fla.myBorder.box.addChild(sprite);

I'd like each sprite to be given a new name like pict1, pict2, pict3, etc but img variable is not increasing. I think this is where my problem occurs. Would someone please help?