how to make this work?
i have a mc that only half part of it visible on stage. the other half is outside. now i want it to tween with easing until all of the mc can be seen on stage when i place mymouse on top of it.
http://www.kirupa.com/developer/mx/easing_mouseclick.htm
It may not do the same thing, but the tutorial itself teaches the method of easing using the easing equation. So everything you need to know is in there.
thanks, that tutorial help. but can a movie clip move when we roll mouse on it. not when we press it. like in button - on (rollOver)
movieclipname.onRollOver = function() {
actions go here
}
or on a frame…
[AS]targetClip.onEnterFrame = function(){
if (this.hitTest(_root._xmouse, _root._ymouse, true){
//ease to location onRollOver
} else {
//ease to location onRollOut (default location)
}
}[/AS]
You run the actions on enterFrame (basically constantly) and check if the mouse x and y position is over your clip, if it is, you ease it to the “out” position using the easing equation, else if it isn’t you ease it back to the original position using the easing equation.
Why hitTest()?
Simple… if you make the movie clip a button as sushis mentioned, you will not be able to have interactive content inside (ie: buttons, input text fields, sliders, or whatever else) because onRollOver converts it to sort of a button state, and you can’t have a button in a button because the main button will get the hit mouse state. hitTest() is a way to do onRollOver and onRollOut without using those actions so it doesn’t convert it to a button state.
Thanks for the info, Lost. That will be helpful on the site I’m building
No problem
hitTest is also used for other things (like in Flash games), but this seems to be one of the popular uses for it outside of game programming.