You didnt call it in the files you posted, you changed that after.. you had
the interval calling a different method (which also didn't exist).. so I
dunno if you did a search and replace or what.. but you had typos..

Also if you trace(bnt_0); or any other bnt_# you get undefined.. so it
doesnt have reference to those clips.. thus you can add a listener..



On 11/14/05, freeman <[EMAIL PROTECTED]> wrote:
>
> When you set it, your interval name is 'Internal' and then within the
> interval you do a clearInterval(classPointer.myInternal). Could this be
> the
> problem?
>
> -freeman
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Bruno
> Mosconi
> Sent: Monday, November 14, 2005 10:31 AM
> To: 'Flashcoders mailing list'
> Subject: RE: [Flashcoders] Listeners Getting CRAZY => Please HELP!
>
> Sure I call It:
>
> private function main():Void
> {
> //HERE I CALL.
> Internal = setInterval(this, "setupBtnListeners", 1000);
> }
>
> private function setupBtnListeners():Void
> {
> trace("setupBtnListeners");
> var classPointer = this;
> clearInterval(classPointer.myInternal);
>
> bnt_0.addEventListener("click", Delegate.create(this,
> clickBt));
> }
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Ryan
> Matsikas
> Sent: segunda-feira, 14 de novembro de 2005 16:20
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] Listeners Getting CRAZY => Please HELP!
>
> you dont call, setupBtnListeners() from anywhere.. how does the listener
> get
> added?
>
> On 11/14/05, Bruno Mosconi <[EMAIL PROTECTED]> wrote:
> >
> > I've got a custom Button Class extending mx.core.UIComponent, it'
> working
> > fine till now...
> >
> > The point is, that I've got a simple DropDown menu, with buttons inside,
> > and
> > as I have a timeline to open it with animation Listeners don't WORK! I'm
> > getting crazy!
> >
> > Compiler gives no error.
> >
> > The file:
> > http://www.ultrafactor.com.br/flash_bug/SelMenu.zip
> >
> > The code:
> >
> > import com.ultrafactor.Button;
> > import mx.utils.Delegate;
> > class com.ultrafactor.SelMenu extends MovieClip
> > {
> > private var myInternal:Number;
> > private var bnt_0:Button;
> >
> > public function SelMenu()
> > {
> > main();
> > }
> >
> > private function main():Void
> > {
> > myInternal = setInterval(this, "setTabButtonListeners",
> > 1000);
> > }
> >
> > private function setupBtnListeners():Void
> > {
> > var classPointer = this;
> > clearInterval(classPointer.myInternal);
> >
> > //DO NOT WORK!
> > bnt_0.addEventListener("click", Delegate.create(this,
> > clickBt));
> >
> > }
> >
> > private function clickBt():Void
> > {
> > trace("clik");//DO NOT WORK
> > }
> > }
> >
> > My custom Button Class:
> > import mx.core.UIObject;
> > import mx.core.UIComponent;
> > class com.ultrafactor.Button extends mx.core.UIComponent
> > {
> > private var initializing:Boolean = true;
> > private var autoRepeat:Boolean;
> > private var interval;
> >
> > function Button()
> > {
> > super.init();
> > useHandCursor = true;
> > }
> >
> > private function size(Void):Void
> > {
> > super.invalidate();
> > }
> >
> > private function draw(Void):Void
> > {
> > if (initializing)
> > {
> > initializing = false;
> > }
> > size();
> > }
> >
> > private function onRollOver():Void
> > {
> > if (interval != undefined)
> > {
> > clearInterval(interval);
> > delete interval;
> > }
> >
> > gotoAndStop(2);
> > }
> >
> > private function onDragOver():Void
> > {
> > onPress();
> > }
> >
> > private function onRollOut():Void
> > {
> > gotoAndStop(1);
> > }
> >
> > private function onDragOut():Void
> > {
> > onRollOut();
> > }
> >
> > private function onRelease():Void
> > {
> > dispatchEvent({type:"click"});
> >
> > onRollOver();
> > }
> >
> > private function onPress():Void
> > {
> > gotoAndStop(3);
> >
> > dispatchEvent({type:"buttonDown"});
> > if (autoRepeat)
> > {
> > interval = setInterval(this, "onPressDelay",
> > getStyle("repeatDelay"));
> > }
> > }
> >
> > private function onPressDelay(Void):Void
> > {
> > dispatchEvent({type:"buttonDown"});
> > if (autoRepeat)
> > {
> > clearInterval(interval);
> > interval = setInterval(this, "onPressRepeat",
> > getStyle("repeatInterval"));
> > }
> > }
> >
> > private function onPressRepeat(Void):Void
> > {
> > dispatchEvent({type:"buttonDown"});
> > updateAfterEvent();
> > }
> > }
> >
> > _______________________________________________
> > Flashcoders mailing list
> > [email protected]
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to