ActionScript 1/2 :: Rotate A Mc 360º In 45º 'smooth' Steps With Buttons Left And Right?
May 6, 2009
I have a circular mc (wheel2) and this should rotate 'smooth' in steps of 45º, to the left and to the right (buttons).The script I use on the button (right);
on(release){var rotate:Function = function (obj:MovieClip) { obj._rotation += 3; if (obj._rotation == 45) { clearInterval(interval); } }; var interval:Number = setInterval(rotate, 10, wheel2); stop(); }
It moves ok 'once' then it spins 360º. Should I set a new value for my mc?
View 14 Replies
Similar Posts:
Dec 7, 2004
I have the following script in both frame 1 and 2 to let a movieclip move from right to left on the stage:
Code:
speed =-5
name._x += speed
if (name._x<-500) {
name._x = 250;
}
And the clip is indeed moving from right to left on the stage and when it reaches _x -550 it is going back to it's starting position _x 250 only the movement isn't smooth at all. What should I do to make the movement more smooth or should I use a completely different script?
View 6 Replies
Apr 30, 2004
I'm trying to do a smooth automatic text scroll from right to left.
Heres the code I made up but it's not as smooth as I'd like it to be:
Code:
myTxt_mc.onEnterFrame = function() {
this._x -= 3.5;
if (this._x <= -3360) {
[Code]....
View 1 Replies
Jul 20, 2006
I have a series of thumbnails that should scroll from left to right & right to left when you roll over the movie clip buttons on either side. IT was working in another flash movie, but I moved it to a different flash file and now it's not working. The hit buttons within the movie clip buttons have this action script:
[Code]....
View 6 Replies
Dec 7, 2004
I have the following script in both frame 1 and 2 to let a movieclip move from right to left on the stage:
[Code]...
And the clip is indeed moving from right to left on the stage and when it reaches _x -550 it is going back to it's starting position _x 250 only the movement isn't smooth at all. What should I do to make the movement more smooth or should I use a completely different script?
View 6 Replies
Apr 12, 2007
I want something to rotate ONCE only when the left key is pressed, but i can't figure it out.
View 4 Replies
Jun 27, 2011
I need to make a MovieClip rotate around it's center point to the left or right depending on mouse drag. I got some basic semblance of what i want going, but it's pretty hackish. Normally i calculate the angle and such but i only really need to use the distance the mouse travels and apply it to the movieclip and for flavor add some nice easing when you let go.
public function Main()
{
var wereld:MainScreen = new MainScreen();
addChild( wereld );
[Code]....
View 1 Replies
Dec 9, 2010
I'd like to know how could I make the green movieclip rotate right and left until it stops?
View 0 Replies
Oct 16, 2010
I'm working on converting my website from xhtml to flash but want my site thumbnails to rotate in 3d left to right. go to http:[url].... and click on "eMail" on the left and see the Gmail thumbnail. I want that to rotate in 3d without skewing.
View 4 Replies
Sep 24, 2008
I have a movieclip that will rotate by 10 right if the right button is pressed, or 10 left if the left button is pressed.Now, some genius tell me why the right button code works perfectly, but when i press left it doesnt rotate. It moves left, but no rotation to be found .heres the code
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
xspeed -= power;[code].....
View 3 Replies
Oct 24, 2004
how to rotate individual jigsaw puzzle pieces using the left and right arrow keys.Here is the action script that I am using:
on (press) {
startDrag("_root.pic9", true);
this.swapDepths(100);[code]....
View 7 Replies
Oct 22, 2010
I'm creating a menu system, the text buttons should, on rollover, move all buttons to the left (of the button currently rolled over) 100 pixels, in the gap created a sub menu running vertically will appear which will break into a 2nd horizontal submenu etc. I'm still in the early stages, and have hit a stumbling block, I placed a trace (this); cmd in root of the roll over function then again in each segement of the IF/ELSE loop inside that fuction. The trace CMD in the root of the rollover gives me the feed back _level0.btn1 or 2 or what ever button I have rolled over but the ones inside the IF/ELSE loop all say _level0.btn0 regardless of the button I roll over!
[Code]...
View 2 Replies
Feb 26, 2009
I have made a map which I have made scrollable across the stage using the keyboard arrow keys.
e.g:
PHP Code:
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
_x=_x-4;
[Code]....
These on screen buttons allow the user to move the map every time they click however it would be more user friendly if these buttons continued to move the map on a hold down state until released or via rolling on/off.
View 1 Replies
May 14, 2009
I want to make an animation which interacts to the overstates of different buttons, but I want the animation to tween between the different states without reseting to a defaut when the mouse cursors off of the button. Another way of saying it is that I want the animation's instances to smoothly transition from one button to the next, no matter what order the buttons are cursored over.
View 5 Replies
Feb 17, 2004
i need to know how to make the silder which rotat object and how can i tell buttons to rotate or resize. i mean when you drag an object what happen to tell buttons to this object is the active one.
View 1 Replies
Oct 21, 2010
I am wanting to create a animation illustrated below, The large button found called big button will trigger nine other buttons and start orbiting the big button clockwise / anti clockwise and click again then it stops. Wanting to know if this is possible in action script??
View 1 Replies
Mar 18, 2010
I am wondering how to make a 360º view bubble, like they use for Google Street View, but have no idea how to go at accomplishing this task... i have the string of photos that i attached in photoshop(so that if you connected the left to the right it would be a full 360º view).
View 1 Replies
Oct 20, 2010
what i have is a circle image (for this purpose lets say it looks like a clock). For example: when you click 3 o'clock, the whole clock needs to rotate around with the 3 o'clock btn at the 6 o'clock position (with the pivot point in the centre). each of the 'time' positions (2 o'clock, 3 o'clock, 4 o'clock ...etc) needs to be a button and thus be able to rotate around to the 6 o'clock position.This would seem simple enough by just using a.rotate value or using tween movieclips...however the tricky part is:the actionscript needs to determine which way the clock turns (anti/clockwise), dependant on where the clicked time-btn's position is. it needs to be some sort of if statement that says:if (3'oclock-btn) is positioned between 0 degrees (being original 12'oclock position) and 180 degrees (original 6 o'clock position), then rotate clockwise to the 6 o'clock position. If the (3o'clock btn) is positioned between 180degrees and 259 degrees (12 o'clock position), rotate anti-clockwise to the 6'oclock position.
View 5 Replies
Sep 13, 2006
I am working on a simple scroller rite now. What it is suposd to do is scroll a row of buttons to the left when you go over the left button and to the rite when you go over the rite button. i am pretty sure i have the wright syntax but i alwasy get an error.
this.btn1.onRollover = Function(){
onEnterFrame;
this.scrolller._x +=3;
};
and its the oppisite for the other button
View 2 Replies
Sep 18, 2009
I know everyone has wrote this a hundred times, BUT I just can't get it to work
I have a main content area called MC that is very wide Then a mask around the area I want to see of the MC
I have two buttons set up below the mask for LEFT and RIGHT
How to I make those buttons move the main content, and stop when It gets to the end of the masked area so you dont just keep scrolling
ALL I HAVE in my code right now, is attached the left and right buttons---
on(release){
MC._y = (MC._y)-50;
}
is there more to it than that? How do I stop it?
View 2 Replies
Feb 9, 2004
I have a movieclip that I want to be resized when a button is clicked. I want the animation to be smooth as if it had weight though. I read the tutorial on this but I need something slightly different, I would rather it where I can just refer to a function that is set in another movieclip. That way I could easily refer to it again and just set the height, width, and if possible, x, and y.
And my second question, is how to keep the border of my movieclip that is going to be resized the same thickness. I want the inside to be resized but the sides to stay the same width but move to stay on the edge.
View 8 Replies
Mar 15, 2007
Im trying to get these five buttons to rotate to differrent degrees using a narray and for loop. However, when I do this, it just takes the last value (-12) and applys it to each button.Check out my code:
Code:
ogRotation = [0,-3,-6,-9,-12];
for(var i=0; i < 5 ;i++){
test = ogRotation[i];
[Code]...
Also, should I just be doing each button seperatley?
View 2 Replies
Mar 25, 2007
I have a circle movieclip that needs to rotate to certain destinations depending on buttons pressed in the navigation. Everything works fine, except when you go from green to cyan and vice versa, it does a full 360 rotation instead of just moving to the destination.
View 13 Replies
Feb 17, 2011
I want to do a web site that is very wide. so i want to put a horizontal menu on the bottom. Lets say i have 5 buttons on my menu and with these buttons i want to move the content left or right. so i could control were i want to be on my website using the buttons that just move the background or content left or right
View 2 Replies
Sep 8, 2011
if (Key.isDown(Key.LEFT) && Math.abs(this["speed"+who])>0.3) {
_root["car"+who]._rotation -= _root.rotationStep2*(this["speed"+who]/_root.maxSpeed);
}
[code].....
View 3 Replies
Nov 21, 2011
How to align the Spark Buttons Icon to the left? / like the icons to be all 3 pixels from the left // I have checked the sking class of the Spark buttons, but they doesnt expose the Icon property for further extending the skin/
View 1 Replies
Aug 3, 2009
I have a big circle with buildings all around the edge. There are two buttons that should control it. One to rotate the circle left, and one to rotate the circle right. I'd like each click of a button to rotate the circle and have it stop on a building, which then would activate an animation of the building.
View 4 Replies
Nov 3, 2010
i am doing this: press buttons on screen to move character left or right, "swipe" elsewhere on screen to do other stuff.
This is how i have handled it:
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
stage.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchBegin);
stage.addEventListener(TouchEvent.TOUCH_END, onTouchEnd);
buttonContainer.addEventListener(TouchEvent.TOUCH_ OVER, tOver);
buttonContainer.addEventListener(TouchEvent.TOUCH_ OUT, tOut);
this works fine, just wondering if anyone has another way to handle it. it seems excessive to have 4 handlers for touch input, but i cant figure out any other way.
TOUCH_OVER and TOUCH_OUT check a switch statement to enable/disable buttons within buttonContainer.
TOUCH_BEGIN and TOUCH_END are used to store points and get a "swipe angle" (only if TOUCH_END is not over a button)
my only problem is i started having glitch's i think becuase so many listeners including: ORIENTATION_CHANGE, KeyboardEvents, Event.DEACTIVATE
this is why i ask if perhaps im missing someway to simplify the touch input listeners
View 1 Replies
Feb 20, 2005
I created the scrolling navigation, akin to [URL] by changing a script that I had. However, I'm stuck now, as all the buttons can move to the left, but not to the right. If it does not make sense, check out the attached swf and fla.
View 2 Replies
Jan 28, 2010
I'm taking a Flash CS4 class at the local community college. Our teacher is making a LOT of assumptions about what we know. Our first assignment is to set up a web site (I've already taken web design I & II, but this is my first exposure to Flash). What I'm looking for is some guidance about the orderly steps to take when setting up a flash web site.I'm thinking I need to go into Photoshop or Fireworks first and design the pages so I can import them.But what about when I get to Flash? Page set-up, size, create layers for each of my pages, import things, where to start adding effects first... I can't decide the most efficient ORDER in which to do things.
View 3 Replies