Цитата:
Сообщение от бакуард
Извиняюсь Samana, не мог сразу ответить.
Нет, вариант предложенный AlexCooper не помог.
|
Значит у вас

Код AS3:
ArrayOfCell[sityMatch.pozition1OfMatch] = null
т.е. в массиве ArrayOfCell нет значения с указанным индексом sityMatch.pozition1OfMatch
Добавлено через 4 минуты

Код AS3:
package cellAndRoadPG.sityPG {
public class SityMatchClass extends SityMatch {
private var sityMatch = this;
public var pozition1OfMatch:uint ;//номер ячейки массива в котором расположена клетка местности
public var pozition2OfMatch:uint;//номер ячейки массива в котором расположена клетка местности
public function SityMatchClass (){
pozition1OfMatch = uint(Math.random() * 110 - 1);
pozition2OfMatch = uint(Math.random() * 110 - 1);
if(pozition1OfMatch < 0){
pozition1OfMatch = 0;
}
if(pozition2OfMatch < 0){
pozition2OfMatch = 0;
}
}
}
}
и

Код AS3:
var sityMatch:SityMatchClass = new SityMatchClass();
if ( ArrayOfCell[pozition1OfMatch] ) {
sityMatch.x = ArrayOfCell[pozition1OfMatch].x;
sityMatch.y = ArrayOfCell[pozition1OfMatch].y;
} else {
trace('ArrayOfCell['+pozition1OfMatch+'] not found');
}
main.addChild(sityMatch);