Hi all,
I am really needing some help with packages. It’s just driving me nuts. I searched everywhere but i simple just get the same error message over and over: 1180 - call to a possibly undefined object.
Here’s the code (I just extracted the most important things of the code…):
====================
===== file path: teste1.fla
import scripts.objetos;
var obj_array:Array = new Array();
…
var obj:Sprite=new Sprite();
obj.name=‘testname’;
obj.z=0;
obj_array.push(new criaObjeto(obj.name, obj.z));
==========================
===== file path: scripts/objetos.as
package {
public class criaObjeto{
private var name:String;
private var sortz:Number;
public function criaObjeto(nome:String, sortz:Number) {
this.nome = nome;
this.sortz = sortz;
}
public function getZ():Number {
return sortz;
}
public function toString():String {
return " " + name + ":" + sortz;
}
}
}
I am using this code to sstore the z position and the child name of each obj.
Thanks for any help!