Re: [Flashcoders] Using components in MovieClips

2006-12-19 Thread chris daubney
I suspect when you mention that move() is not working then you are trying to invoke this on the Button components from within createChildren() . This will also not work as child UIObject components are not fully initialised until the next frame. UIObject has a doLater() function which will def

Re: [Flashcoders] Using components in MovieClips

2006-12-19 Thread R�kos Attila
You have to wait while the components are initializing themselves. Usually I place my initialization code accessing the on-stage children components in the onLoad method of the container movieclip/component. private function onLoad():Void { roomShape_btn.toggle = true; roomShape_btn.addEve

Re: [Flashcoders] Using components in MovieClips

2006-12-19 Thread T. Michael Keesey
One more note: If you're using mx.controls.Button instead of the top-level Button class, then ignore what I said. In that case, you might be calling addEventListener before the component has run its own constructor. Do some traces to see if that is the case. Where are the calling createChildren()

Re: [Flashcoders] Using components in MovieClips

2006-12-19 Thread Adrian Ionut Beschea
David, how do you declare your button ? do you use var some_btn:Button or var some_btn:mx.controls.Button ? You should use the second so that the compiler would load the component class. David Ham <[EMAIL PROTECTED]> wrote: Hi, I was having trouble with some components yesterday. I am

Re: [Flashcoders] Using components in MovieClips

2006-12-19 Thread T. Michael Keesey
I'm assuming this is AS2. You should use mx.utils.Delegate, like so: roomShape_btn.onRelease = Delegate.create(this, click); The AS2 Button class is not part of the MX architecture. It doesn't use the event dispatcher pattern. On 12/19/06, David Ham <[EMAIL PROTECTED]> wrote: Hi, I was having

[Flashcoders] Using components in MovieClips

2006-12-19 Thread David Ham
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 t