View Full Version : Rotate platform with mouse position
jbog91
February 4th, 2007, 02:20 AM
I'm trying to come up with a tutorial for this game here: http://www.flashgame-online.com/free-games/skill/jeu-chiant.html
However, I can't seem to figure out how to rotate the platform below just based on where the mouse is on the stage. Does anyone have a tutorial or some code on this? Thanks. :cubs:
SacrificialLamb
February 4th, 2007, 03:07 AM
pp is the name i gave to the line MC
n = 90/Stage.width
pp.onEnterFrame = function(){
this._rotation = 45 - (n * _xmouse)
}
jbog91
February 4th, 2007, 02:01 PM
Hey. Thanks for the response but it doesn't seem to work for me. Could you post a fla or something? I created the movie clip pp and I added the action to a layer above it. It didn't work that way so I added the action to the movie clip and got an error.
SacrificialLamb
February 4th, 2007, 10:41 PM
make the MC instance name "pp" (you know just under Movie Clip at the upper right of the properties panel) not just the MC in the library
or the same code for putting on the MC is
onClipEvent(load){
n = 90/Stage.width
}
onClipEvent(enterFrame){
this._rotation = 45 - (n * _root._xmouse)
}
You know if you don't know how to make the code for the game and rewriting/fixing that code I gave you was beyond you I might question your qualifications to be trying to teach others
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.