Hi,
There is no need for the EventDispatcher. You just assign the function to the relevant onRelease properties.
Code:import mx.utils.Delegate; class main_movie extends MovieClip { public var pbSend:Button; public var my_mc:MovieClip; public var my_button:MovieClip; // constructor public function main_movie() { my_mc = attachMovie ("my_mc", "my_mc", getNextHighestDepth(), {_x :100, _y:50} ); my_button = attachMovie ("my_button", "my_button", getNextHighestDepth(), {_x :100, _y:50} ); my_button._x = 100; } // I would rather do it here... private function onLoad () { my_mc.onRelease = my_button.onRelease = Delegate.create(this, checkFields); } private function checkFields():Void { trace("check"); } }




Reply With Quote