mercredi 25 novembre 2015

AS3 concat // MovieClip(parent).variable.gotoAndStop(otherVariable);

Is there any concatenation problem in MovieClip(parent).robes_position_num_clicked.gotoAndStop(traje1); ?

When I click on item n°2, trace('robes_position_num_clicked') returns "robes_position2", which is correct & what expected, but

var index_clicked:int = myPositions.indexOf(; // = Position num in array
var robes_position_num_clicked ="robes_position"+(index_clicked+1).toString();
  trace (robes_position_num_clicked);

 var traje1 = MovieClip(parent).robes_position1.currentLabel;

 if (   MovieClip(parent).robes_position1.currentLabel==traje1 &&  MovieClip(parent).robes_position1.currentLabel!=null)
    {   /*1*/ MovieClip(parent).robes_position2.gotoAndStop(traje1);
        /*2*/ MovieClip(parent).robes_position_num_clicked.gotoAndStop(traje1);   

The first "sentance" /* 1*/ does the expected job,
while sentance /* 2*/ which is supposed to be a synonym, doesn't, and returns an error "One term is undefined and has no property"

Thanks for your lights as we say in french !

Aucun commentaire:

Enregistrer un commentaire