Groups | Blog | Home
all groups > flash actionscript > november 2007 >

flash actionscript : how to call a referenced object.method



dsdsdsdsd
11/3/2007 12:16:38 AM
hello;

I am trying to call a class.method using a reference to the class:


my_class = function()
{ this.listener_method = function( args )
{ trace( args ) ;
}
my_object.register_something ( this , "listener_method" ) ;
}

my_object = new Object();
my_object.register_something = function( arg_reference_to_class_or_object ,
arg_method )
{ // ?????????????????
arg_reference_to_class_or_object.arg_method( "howdy" ) ;
// so here I want to use the received arguments to call back;
// in Lingo I just use 'call' but Flash's 'call' does something different;
};

any thoughts?

thanks
dsdsdsdsd










dsdsdsdsd
11/3/2007 1:00:26 AM
solution:

arg_reference_to_class_or_object[ arg_method ].call( "howdy" ) ;
AddThis Social Bookmark Button