Why doesn't variable img increase?
Posted
by Annette B
on Stack Overflow
See other posts from Stack Overflow
or by Annette B
Published on 2009-08-30T01:13:05Z
Indexed on
2010/04/12
15:03 UTC
Read the original article
Hit count: 169
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?
© Stack Overflow or respective owner