Results 1 to 4 of 4
Thread: Make script work in As3
-
April 8th, 2012, 11:23 PM #136Registered User
postsMake script work in As3
I have a script that makes a set of frames move back and forth by use of the mouse in As2
I would like to use it in As3 but couldnt figure out how to modify it. Could someone please help me make this work in As3
Thanks
stop();
onMouseMove = function() {
gotoAndStop(Math.floor(_root._ymouse*(_root._total frames)/(_root._height)));
updateAfterEvent();
}
-
April 8th, 2012, 11:31 PM #2
What did you do to try to figure out how to make it work in AS3?
-
April 9th, 2012, 04:11 AM #3
If your code is in the main timeline (not inside a class) - and I suppose it is, because of your stop() function - I would do something like this:
I haven't test it, but it should work. Let me know if you get some compile or runtime errors. Hope it helps.Code:import flash.Events.MouseEvent; stop(); addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); function onMouseMove (evt:MouseEvent) { gotoAndStop(Math.floor(this.mouseY*(this.totalFrames)/(stage.stageHeight))); updateAfterEvent(); }
-
April 9th, 2012, 06:48 AM #4

Reply With Quote
We tolerate living and breathing. And niches.
Bookmarks