-
[MX04] I need help on how to rotate an mc using a separate button
I need help on how to rotate an mc using a separate button. This is the actionscript I'm using...
var sOb = "";
var num:Number = 0;
Ob_array = new Array("bed", "armoire", "dresser");
Obclick = function () {
startDrag(this, true);
this.swapDepths(_root.getNextHighestDepth());
this._alpha = 50;
_root.sOb = this;
};
Obrelease = function () {
this._alpha = 100;
if (sOb.hitTest(trash._x, trash._y, true)) {
removeMovieClip(sOb);
}
};
for (var i in Ob_array) {
var ob:MovieClip = eval(Ob_array[i]);
ob.onPress = function() {
var nOb:MovieClip = attachMovie(this._name, this._name+(++num), _root.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50});
_root.sOb = nOb;
nOb.onPress = Obclick;
nOb.onRelease = nOb.onRollOut=Obrelease;
startDrag(nOb, true);
};
}
onMouseUp = function () {
stopDrag();
};
Thanks
-
Code:
btnRIGHT.onPress = function(){
_root.sOb._rotation += 10;
}
-
do I have to create a "button" mc? Where exactly do I insert this actionscript?
-
Yes.
Right below your existing code is fine.
See attached for example.
Last edited by dawsonk; 08-22-2007 at 10:52 AM.
-
Got it dawsonk! I highly appreciate your help! Thanks!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|