Reputation: 3223
I want a scrollbar to show up when the onmouseover
event is triggered on element A
.
How is this done with actionscript 3?
Upvotes: 0
Views: 1639
Reputation: 31
for this explanation :
Code:
import flash.events.MouseEvent;
toggleScrollbar(new MouseEvent(MouseEvent.ROLL_OUT));
spriteA.addEventListener(MouseEvent.ROLL_OVER, toggleScrollbar);
spriteA.buttonMode = true;
//and if needed:
spriteA.addEventListener(MouseEvent.ROLL_OUT, toggleScrollbar);
private function toggleScrollbar(e:MouseEvent):void
{
switch(e.type)
{
case "rollover":
scrollbar.visible = true;
break;
case "rollout":
scrollbar.visible = false;
break;
default:
break;
}
}
Upvotes: 3
Reputation: 1243
A.addEventListener(MouseEvent.MOUSE_OVER, showScrollbar);
A.addEventListener(MouseEvent.MOUSE_OUT, hideScrollbar);
function showScrollbar(e:MouseEvent):void
{
//make the scrollbar visible
}
function hideScrollbar(e:MouseEvent):void
{
//hide the scrollbar again
}
Upvotes: 0