shoeshine159
09-18-2007, 08:58 AM
Gday, i'm new to Classes in actionscript, I've been trying to get my head around classes recently.
Here is my problem. how do i call a method (function) of an instantiated class from inside another class? nothing i do seems to work.
Heres what i'm doing. I have 3 classes.
InterfaceLayer, NodeLayer, and LoginPanel.
i instantiate them as children of DocumentClass as iLayer and nLayer.
and child of InterfaceLayer as login.
within NodeLayer is a function drawNode() which i want to call from InterfaceLayer's child login.
so within login am i allowed to call nLayer.drawNode() ? because it doesn't seem to work. "1120: Access of undefined property nLayer."
or parent.parent.nLayer "1119: Access of possibly undefined property nLayer through a reference with static type flash.display:DisplayObjectContainer."
can anyone help me from just this or should i post some source. it's gotten quite complex already.
thanks in advance.
Here is my problem. how do i call a method (function) of an instantiated class from inside another class? nothing i do seems to work.
Heres what i'm doing. I have 3 classes.
InterfaceLayer, NodeLayer, and LoginPanel.
i instantiate them as children of DocumentClass as iLayer and nLayer.
and child of InterfaceLayer as login.
within NodeLayer is a function drawNode() which i want to call from InterfaceLayer's child login.
so within login am i allowed to call nLayer.drawNode() ? because it doesn't seem to work. "1120: Access of undefined property nLayer."
or parent.parent.nLayer "1119: Access of possibly undefined property nLayer through a reference with static type flash.display:DisplayObjectContainer."
can anyone help me from just this or should i post some source. it's gotten quite complex already.
thanks in advance.