Skip to main content
April 27, 2006
Answered

referencing a Var in a class file

I am trying to reference a public variable that is defined in a class file, from inside a function of the same class file.

This is only a problem when I try to reference it from inside an onLoad function for loading an external file.

'this' then references [object Object] when it should be _level0.instance1 for example.
'_parent' is undefined.

any help is appreciated.
finty
This topic is closed to new replies. Start a new post to keep the conversation going.
Peter LorentCorrect answer
Inspiring
April 27, 2006
See attached.

4 replies

Inspiring
April 27, 2006
Use a local reference to the current object.
var thisObj=this;
Load_lv.onLoad=function():Void{
//code...
thisObj.prop=this.something;
Translate
Peter LorentCorrect answer
Inspiring
April 27, 2006
See attached.

Translate
April 27, 2006
I knew it was something simple! Thanks for the help
Translate