Hi,
I was having trouble with some components yesterday. I am writing a
NavigatonView class that extends UIObject. I linked it to a symbol in the
library that had four Button components in it. The symbol had no code in it;
the code for the class was entirely in an external .as file.
Here is the trouble: the Button components appear on stage, but only as
Movieclips, they do not respond to component commands like move(), and they
do not register calls to addEventListener(). However, they respond visually
when I roll over them, and I can attach functions to their onRelease. What
gives?
Here is the code from the class:
private function createChildren():Void {
trace("CREATECHILDREN");
roomShape_btn.toggle = true;
//roomShape_btn.addEventListener( "click", this );
//resizeRoom_btn.addEventListener( "click", this );
//editCorners_btn.addEventListener( "click", this );
//placeObjects_btn.addEventListener( "click", this );
roomShape_btn.onRelease = click;
resizeRoom_btn.onRelease = click;
editCorners_btn.onRelease = click;
placeObjects_btn.onRelease = click;
}
function click(evt:Object) {
trace( this );
}
The commented lines do not work (and yes, I did try uncommenting them first,
har har) but the onRelease ones do.
Incidentally, component instances that I create dynamically with
createClassObject() work as expected.
Thanks for any help you can offer,
OK
DAH
_______________________________________________
[email protected]
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