luksy
August 15, 2002, 9:06pm
1
I asked this before but I was unable to view the answer because I had problems with a modem. So here’s the question.
When you drag a mc it rotates. And when you release drag, it stops rotating and it stays at that point.
Thank you and also I am sorry.
system
August 16, 2002, 5:58am
2
this might work.
place a button inside the movie clip in question… on it’s timeline.
attach to the outside of the movie clip that contains the button, this code
onClipEvent(enterFrame){
if(flag){
this._rotation++;
}
}
attach to the button this script.
on(press){
_parent.startDrag();
_parent.flag=true;
}
on(release){
_parent.stopDrag();
_parent.flag=false;
}
system
August 16, 2002, 2:19pm
3
Sorry, Dave… I don’t know if that would work. I’ll give it a shot, though.
My first thought was to make a simple tween that rotate the object
on the movie clip, this code.
onClipEvent(load){
gotoandstop(1);
}
on(press){
_root._xmouse=this._x;
gotoandplay(1);
this.startdrag();
}
on(release){
gotoandstop(this._currentframe);
this.stopdrag();
}
system
August 17, 2002, 3:47pm
4
David’s code didn’t seem to work but when you change one line it works perfectly.
onClipEvent(enterFrame){
if(_root.flag){
this._rotation++
}
}
on(press){
this.startDrag();
_root.flag=true;
}
on(release){
this.stopDrag();
_root.flag=false;
}
if you just change the code from _parent to _root it seems to work perfectly.
Hope this helps
Kyle
system
August 17, 2002, 4:06pm
5
oh yeah… I forgot to direct that correctly. If it works that way it should also work like this
onClipEvent(enterFrame){
if(flag){
this._rotation++
}
}
on(press){
this.startDrag();
flag=true;
}
on(release){
this.stopDrag();
flag=false;
}
I forgot that a button on the timeline would make a variable on that timeline, which in turn would be readable localy by the movieclip onClipEvent(){} method.
system
August 17, 2002, 4:16pm
6
and if you want to make it go faster change this._rotation++ to this._rotation += 5. You change the number 5 to any number you want, the highter the number the faster the rotation.
system
August 19, 2002, 3:56pm
7
THank you! Thank you! That’s ok. The first post already helped me! :))
OK. Over.