我在stage1中有1个classA,在stage2中有1个classB。 在stage1上有一个movieclip实例名称MC。 在stage2上有一个movieclip实例名称MC(与stage1相同的实例名称)。
CLASSA:
package {
public class classA extends MovieClip {
public function classA(): void {
}
public function prenditutti(obj: MovieClip): void{
//mc is movieclip in stage1 and work correctly
MC.addChild(obj);
}
}
}
classB :(我在stage2中使用它,并且有一个movieclip实例,就像在stage1中一样,名为mc)
package {
import livingroom;
public class classB extends MovieClip {
//calamita_inventario is a movieclip linkage in library
public var calamita_inv_cost: calamita_inventario = new calamita_inventario();
public var LR: classA = new classA();
public function classB() {
// constructor code
}
public function prendicalamita(e: MouseEvent) {
LR.prenditutti(calamita_inv_cost);
//I should see in stage2 inside a MC my movieclip calamita_inv_cost, but doesn't work.
}
}
}
但是在stage2中我看不到addChild。 需要帮助