MikeBronner
Programmer
I would like to pass the reference of the instance of class A from within itself to class B, so that I can perform a callback from class B, once it has completed its processing.
How is this possible?
My current work-around, which I am trying to get away from, is hard-coding the class A instance that I declared outside of either classes, inside of class B. Something like this:
What I would like to get to is something like this:
I'm trying to get my head around this. Thanks!
Take Care,
Mike
How is this possible?
My current work-around, which I am trying to get away from, is hard-coding the class A instance that I declared outside of either classes, inside of class B. Something like this:
Code:
var myClass = new classA();
function classB()
{
function do_this()
{
// [...]
myClass.do_that();
}
}
Code:
var myClass = new classA();
myClass.run_me_first();
function classA()
{
function run_me_first()
{
// [...]
var mememe = new classB();
classB.do_this([reference to this class here]);
}
function do_that()
{
// [...]
}
}
function classB()
{
function do_this(o_class)
{
// [...]
o_class.do_that();
}
}
I'm trying to get my head around this. Thanks!
Take Care,
Mike