Hello
I have been working on a website where I make heavy use of dispatching
events and such. Works all nice. But out of the dark some part of the
code got broken. I am using a AS2 class around my buttons so it will
dispatch a event at all clipevent methods. Sample snippet:
// dispatch method dispatches an event onRelease to the listeners
public function onRelease() {
trace( "MOVIE-BUTTON EVENT: onRelease" );
this.gotoAndPlay( "onRelease" );
dispatchEvent( {type:"onRelease", target:this} );
}
As you see the movieclip will go to the frame with the label "onRelease"
and then dispatches the event onRelease. This all works fine when the
user really clicks on the button. Only when I am doing it by code, through:
navigation.home_btn.onRelease();
Somehow the event doesn't get dispatch I do see the trace-message in the
Output palette but the delegated method for the onrelease-event doesn't
get triggered. The code I use for binding it is: [with in a simple
iteration through a array]
var currNavItem = navigation[ navigationItems[i] + "_btn" ];
currNavItem.addEventListener( "onRelease",
mx.utils.Delegate.create( this, handleMenuButtonClick ) );
Does anyone know why this doesn't work when I trigger the
onRelease-method by code?
Yours,
Weyert de Boer
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com