You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MarinMoulinier edited this page Apr 7, 2012
·
2 revisions
This is a class that extends FlxButton. You can call it whenever a button is Hovered.
packageco.cc.aberustudios.FlxExtends
{
import org.flixel.FlxButton;publicclassAButtonextendsFlxButton
{
/*** This function is called when the button is hovered.*/protectedvar_callover:Function;/*** Used to handle Callover.*/protectedvar_called:Boolean;publicfunctionAButton(X:int, Y:int, Callback:Function, Callover:Function)
{
super(X, Y, Callback);_callover= Callover;_called=false;
}
overridepublicfunctionupdate():void
{
super.update();if(_on.visible)
{
if(!_called)
{
_called=true;_callover();
}
}
elseif(_off.visible)
{
if(_called) _called=false;
}
}
}
}