Foros del Web » Creando para Internet » Flash y Actionscript »

error en class de actioscript 2

Estas en el tema de error en class de actioscript 2 en el foro de Flash y Actionscript en Foros del Web. Tengo el siguiente script: import Anuncio /*****************************************/ var numAnuncios : Number; var imgPath : String; //_root.stop(); /*******************************************/ var xmlVars:XML = new XML(); xmlVars.ignoreWhite = true; ...
  #1 (permalink)  
Antiguo 02/03/2004, 11:18
 
Fecha de Ingreso: marzo-2002
Ubicación: Guadalajara Jal.
Mensajes: 93
Antigüedad: 22 años, 1 mes
Puntos: 0
error en class de actioscript 2

Tengo el siguiente script:

import Anuncio
/*****************************************/
var numAnuncios : Number;
var imgPath : String;
//_root.stop();

/*******************************************/
var xmlVars:XML = new XML();
xmlVars.ignoreWhite = true;

xmlVars.onLoad = function (sucess:Boolean) {
if (sucess) {
var aux1:String;
var aux2:String;

_root.numAnuncios = Number(this.firstChild.attributes.cant);
_root.imgPath = this.firstChild.attributes.imgPath;

var nodos : Array = this.firstChild.childNodes;
for (i:Number = 0; i < 1; i++) {
//si es anuncio
if (nodos[i].nodeName == "anuncio") {

aux1 = nodos[i].firstChild.firstChild.nodeValue
aux2 = _root.imgPath + nodos[i].attributes.imgName

var newAnuncio: String = "anuncio"+i;
var _root[newAnuncio]:Anuncio = new Anuncio(aux1,aux2);
}
}
} else {
trace("error");
}
}
xmlVars.load("anuncios.xml");


y me devuelve el siguiete error: ¿que estoy haciendo mal?

**Error** Scene=Scene 1, layer=acciones, frame=1:Line 28: Syntax error.
var _root[newAnuncio]:Anuncio = new Anuncio(aux1,aux2);
  #2 (permalink)  
Antiguo 02/03/2004, 11:19
 
Fecha de Ingreso: marzo-2002
Ubicación: Guadalajara Jal.
Mensajes: 93
Antigüedad: 22 años, 1 mes
Puntos: 0
aqui esta a clase

class Anuncio extends MovieClip {
private var link: String;
private var img: String;
function Anuncio (l:String, i:String) {
this.link = l;
this.img = i;
this.loadMovie(img);
}

public function getlink ():String {
return this.link;
}

public function getimg ():String {
return this.img;
}

public function setlink (l : String):Void {
this.link = l;
}

public function setimg (i: String):Void {
this.img = i;
}

public function onRelease () {
getURL(this.link);
}

}
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:05.