Hi Michael,

First: You may NEVER ever ever use _root in a class. A class has to be able to function anywhere, and the way you have coded it now, it needs a fixed timeline to work. Pass '_root' as an argument to the constructor and store it as an instance variable.

And inside the onEnterFrame, you can use 'this' to refer to the tooltip movieclip.
Are you certain it is removed (trace(this)) or is it just out of sight ?

Greets,
Jeroen Beckers

Mendelsohn, Michael wrote:
Hi list...

I can't figure out why the onEnterFrame attached to _root.tooltip in my
displayTip function removes that MC after one frame.  If I set the
onEnterFrame to alter any other MC on the stage, no problem, but when I
set it to alter itself, it errors.  Any ideas?

Thanks,
- Michael M.

class toolbarFunctions extends MovieClip {
        private var tipID:Number;
        function toolbarFunctions() {
        }
        function onRollOver():Void {
                tipID = setInterval(this, "displayTip", 1000);
        }
        function onRollOut():Void {
                _root.tooltip.removeMovieClip();
                clearInterval(tipID);
        }
        function displayTip():Void {
                clearInterval(tipID);
                _root.createEmptyMovieClip("tooltip", 554);
                _root.tooltip.createTextField("tip", 1, 0, 0, 100, 100);
                _root.tooltip.tip.text = "hi";
                // FAILS HERE:
                _root.tooltip.onEnterFrame = function():Void  {
                        _root.tooltip._x = _root._xmouse;
                        _root.tooltip._y = _root._ymouse;
                };
        }
}

_______________________________________________
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

_______________________________________________
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

Reply via email to