rfan622
08-13-2004, 02:33 PM
I have an event that is to be triggered a MC's OnPress and OnMouseMove. However when I make the event a function, the OnMouseMove is not continuous rather it only runs it at the end of the move. While when I insert the code in the function ala AS 1.0, the runs the function continously (what I desire the function to do).
Here's some code to better illustrate my point. This is ran from within the MC.
Example 1
this.OnPress = function () {
mouseListener.onMouseMove = function() {
//manipulate x,y of movieclips
}
}
VS.
Example 2
this.OnPress = function () {
function manipMC(x,y) {
//code to manipulate
}
mouseListener.onMouseMove = manipMC(g_x,g_y);
}
Example 1 works as I want it to. The manipulation occurs while the mouse is moving and the clip is pressed. However in example 2, the manipulation only occurs when the clip is released.
Here's some code to better illustrate my point. This is ran from within the MC.
Example 1
this.OnPress = function () {
mouseListener.onMouseMove = function() {
//manipulate x,y of movieclips
}
}
VS.
Example 2
this.OnPress = function () {
function manipMC(x,y) {
//code to manipulate
}
mouseListener.onMouseMove = manipMC(g_x,g_y);
}
Example 1 works as I want it to. The manipulation occurs while the mouse is moving and the clip is pressed. However in example 2, the manipulation only occurs when the clip is released.