Hi!
I’ve been asking on several forums for a solution to this very basic problem but without a solution:
I’m working inside a movie clip. On one layer I have a movie clip (a block of text and some images known by the instance name “faq_1”) and on another I have two buttons in the form of arrows that have the instance names “up_1” and “down_1”…perhaps you see where I’m going here…
Anyway, what I wish to achieve is that when the user rolls over either button, “faq_1” will smoothly scroll (with physics) up or down. I do not wish “faq_1” to roll to a specific position, rather it ought be commensurate with the amount of time the cursor is held over the button.
So far I have been pointed in this direction:
Up_1.addEventListener(MouseEvent.MOUSE_OVER, goUp);
function goUp(e:Event)
{
Faq_1.y -=10;
Down_1.removeEventListener("enterFrame",goDown);
}
Down_1.addEventListener(MouseEvent.MOUSE_OVER, goDown);
function goDown(e:Event)
{
Faq_1.y +=10;
Up_1.removeEventListener("enterFrame",goUp);
}
However on mouse over it moves just the ten px and stops. I have to move out then over again.
Also, it would be useful to know how I get it to limit movement within an area - so that it stops once y=-200 or something…!
Thanks!