Ser�a una cosilla as�:
 
for (i=1;i<=6;i++) {
    if (this._x==eval("_root.objetivo" add i add "._x") && this._y==eval("_root.objetivo" add i add "._y") {
        set("_root.casilla" add i, false);
    }
}
 
Salu2
----- Original Message -----
Sent: Monday, July 02, 2001 8:26 AM
Subject: [flashmaestro] varias sentencias IF

Mi duda es sencilla, �como podria sustituir esta lista de sentencias por un for o por un while (tengo problemillas con la sint�xis que no se resolver)?   
 
    if ((this._x)==(_root.objetivo1._x) and (this._y)==(_root.objetivo1._y)) {
        _root.casilla1 = false;
    }
    if ((this._x)==(_root.objetivo2._x) and (this._y)==(_root.objetivo2._y)) {
        _root.casilla2 = false;
    }
    if ((this._x)==(_root.objetivo3._x) and (this._y)==(_root.objetivo3._y)) {
        _root.casilla3 = false;
    }
    if ((this._x)==(_root.objetivo4._x) and (this._y)==(_root.objetivo4._y)) {
        _root.casilla4 = false;
    }
    if ((this._x)==(_root.objetivo5._x) and (this._y)==(_root.objetivo5._y)) {
        _root.casilla5 = false;
    }
    if ((this._x)==(_root.objetivo6._x) and (this._y)==(_root.objetivo6._y)) {
        _root.casilla6 = false;
    }
                                                        Gracias..

Responder a