Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

restricting Actions to a movieclip 1

Status
Not open for further replies.

Parcival21

Technical User
Aug 27, 2002
186
DE
Hi there,

Sorry to bother you all again. But I still don't get my programm working.
How can I make it possible that the action called by a mouse movement areonly executed when the mouse is over my movieclip, in this case a scrollable object.
I wrote the following Actionscript:

onClipEvent (load)
{
ycenter=395;
speed=1/50;
}

onClipEvent (enterFrame)
{
var distance=_root._ymouse-ycenter;
_y+=(distance*speed);
if (_y > -175) _y=-1410;
if (_y < -1410) _y=-175;

}
Now my object moves up and down not only when the mouse is on the object but all the time.
I tried to put something in like:
On...{
onClipEvent{
...
}
}
But this isn't posiible.
How can I solve my problem?

Thanks's for any help,

busche
 
you need hitTest somethink like this

onClipEvent (enterFrame) {
if (hitTest(_root._xmouse, _root._ymouse, true)) {
//do something
}
}


_______________________________________
You know you're old if you can remember when bacon, eggs and sunshine were good for you
 
Hi billwatson,

Thank's again,
this was exactly what I was looking for.

busche
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top