Hi, I’m trying to make a basic mouesover and mouseout that will display a help/key box on the screen. I created the help box that will be displayed as a symbol called helpbox. I updated the linkage to export to Actionscript and called the class Helpme.
The object I’m using to instantiate the Helpme class is a small graphic called helpcoast. I want the “helpbox” in the new class “Helpme” to be displayed only when the mouse is over the helpcoast graphic. When I test the movie and mouse over and mouse out of the graphic once, I get no errors, but if I mouse over it, then off it, then back over again, I get this error in the output box:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:DisplayObjectContainer/removeChild()
at MethodInfo-9()
Here’s my code:
helpcoast.addEventListener(MouseEvent.MOUSE_OVER,sayhelp)
function sayhelp(e:MouseEvent):void
{
var whatnow:Helpme = new Helpme;
addChild(whatnow);
whatnow.x = 650;
whatnow.y = 140;
helpcoast.addEventListener(MouseEvent.MOUSE_OUT,stophelp)
function stophelp(e:MouseEvent):void
{
removeChild(whatnow);
}
}
Thanks for the help. I’m still new to Flash/ActionScript
~Josh