ActionScript 2.0 :: Pausing MovieClips Rotating Around Center Axis

Nov 30, 2009

I have 4 movie clips rotating around a center axis. I know how to make each one pause individually, but I don't know how to get them all to pause when you roll over just one of them. Right now it only pauses the one you roll over and the others continue to rotate. I have this code pasted into the actions of each movieclip that is rotating.

Code:
onClipEvent (load) {
var radius = 220;
var speed = .6;
var xcenter = 450;
var ycenter = 300;
[Code] .....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Rotating Clip Along Y-axis?

Sep 16, 2009

I have a rectangular movie clip which I am rotating along its y-axis according to the position of the mouse, using this code:

PHP Code:

rotateClip.addEventListener(Event.ENTER_FRAME, doTilt);
function doTilt(e:Event):void {
var clipToTilt:MovieClip = MovieClip(e.target); 
clipToTilt.rotationY = (stage.mouseX-400)/10; // The stage width is 800
}

When I position the clip in the centre of the stage (x=400) the function works fine - the clip rotates from -40 to 40 degrees, and the perspective effect looks the same at each extremity. However, when I change the x co-ords of the clip to 600 it still rotates in the range -40 to 40 degrees; but it looks as if it's turned much further round at -40 degrees than it does at 40 degrees. Surely if it's rotating by the same amount it should look the same, wherever it's positioned on the stage? I've changed the vanishing point of the object to x=600, but it doesn't seem to make any difference.

The reason I'm using the centre of the stage as a reference is because I want the clip to appear un-rotated when the cursor is in the centre of the movie. Is there another value I should be setting, or have I misunderstood the concept of rotating along an axis?

View 4 Replies

ActionScript 3.0 :: Rotating Object Around Its Own Axis?

Jul 4, 2009

On the web there's a bunch of tutorial on how to rotate an object around a point ,or a stage axis..But how do we rotate this object around its own axis?

View 10 Replies

ActionScript 3.0 :: Rotating Round Y Axis Changes Size Of Object?

Oct 14, 2009

I have an flv file which I am playing through an flv playback component. The flv has a width of 320 pixels, however I wish to dynamically control the width of this flv, therefore I have placed it in a movieclip, and set the width to an arbitrary figure (400 in the example below). All of this works fine.

If I then decide to add a function to spin the Movie clip round 360Deg on the Y access, by the time my Movie Clip has done a full circle it is smaller than it was (now 361 pixels).

If I keep the Movie Clip at the same width as the original flv, there is no problem, and if I reduce the width before the spin, then post spin the Movie Clips width is wider.

Code:
import fl.video.*;
var vid:FLVPlayback;
vid = new FLVPlayback();
vid.source = "Media/Some.flv";

[Code]......

View 0 Replies

Rotate Object Around Center Axis?

Oct 4, 2010

I'm using CS3 with ActionScript 3.0. What I want is simple, and I've done some searching but nothing that can get me the right results.I'm going to post a link that does exactly what I want: http:[url]......This rotates the circular object around a center point in a way that you can distort the object yet is still remains turning in a circular motion. A simple motion tween rotating the image will only work if the object is perfectly round, so distorting the object to make it more straight or curved won't work with a simple tween. I want to do exactly what is happening here (with my own object), is there some AS3 behind the scenes here making this turn on a center point?

View 3 Replies

ActionScript 3.0 :: Remove The Mirror Effect When Rotating An Object On The X Or Y Axis?

Jan 29, 2010

I want to rotate the object on these axes, but it's causing a problem in that I want to flip the image 180 degrees only, however the image becomes mirrored when it flips and you must continue rotating another 180 degrees to get it back to normal.

Is there a way to take off the image mirror when rotating something?

View 1 Replies

Professional :: Rotate A Object Around Center Axis?

Oct 4, 2010

I'm using CS3 with ActionScript 3.0.  What I want is simple, and I've done some searching but nothing that can get me the right results.  I'm going to post a link that does exactly what I want:This rotates the circular object around a center point in a way that you can distort the object yet is still remains turning in a circular motion  A simple motion tween rotating the image will only work if the object is perfectly round, so distorting the object to make it more straight or curved won't work with a simple tween.  I want to do exactly what is happening here (with my own object), is there some AS3 behind the scenes here making this turn on a center point??

View 5 Replies

ActionScript 3.0 :: Rotate Object Around Center Axis?

Oct 4, 2010

using CS3 with ActionScript 3.0. What I want is simple, and I've done some searching but nothing that can get me the right results. I'm going to post a link that does exactly what I want:This rotates the circular object around a center point in a way that you can distort the object yet is still remains turning in a circular motion. A simple motion tween rotating the image will only work if the object is perfectly round, so distorting the object to make it more straight or curved won't work with a simple tween. I want to do exactly what is happening here (with my own object), is there some AS3 behind the scenes here making this turn on a center point?

View 3 Replies

ActionScript 3.0 :: Custom Class Registration - Rotating At 0 - 0 Axis And Not At The Centre Of The MovieClip

Apr 3, 2009

I posted a question regarding how to make a ladybug move around the screen and I managed to make a class that loaded a ladybug png then using a timer moves the bug around the screen...
but I have a huge problem...this has been bugging me all day and cannot find a solution...
The ladybug moves around the screen but rotates towards the moving direction before moving. The problem is that the ladybug is rotating at 0,0 axis and not at the centre of the movieClip. Is there a way to offset the registration point so that the ladybug rotates centred?

[Code]...

View 1 Replies

ActionScript 2.0 :: Rotating Mc In Its Center?

Feb 18, 2003

my problem is that even if the registration point of the MC I want to rotate is in its center it keeps rotating in its upper left corn.The MC is a jpg I load dynamically.The syntax I use is : _root.photo._rotation += 90;

View 14 Replies

ActionScript 2.0 :: Drag And Drop Around A Fixed Center Axis?

Apr 19, 2006

I nedd to build a "See if you have the right weight" wheel in Flash. It have to be a small wheel over a bigger one. The top one have to be drag and drop like it was pined to the other one, so it rotates around the center axis (when click and drag with the mouse over), allowing us to match the scales in the wheels as we like.

I've found a lot of tuturials about drag and drop objects in Flash, but freely, not around a fixed center axis.

View 1 Replies

IDE :: Images Rotating Around Center Point?

Dec 10, 2009

how to do an effect like the one seen on this page?: http:[url]....

View 1 Replies

ActionScript 3.0 :: Rotating Circle From Center With Mouse/

Jan 31, 2010

I have been working on this and thinking about it for days but I just can't seem to get it right. I want to have a circle that I can "pick up" with the mouse and then rotate (with the rotation point in the center). Currently I have done this with the following code:

PHP Code:

var radians = Math.atan2(mouseY-circle.y, mouseX-circle.x);
var degrees = Math.round((radians*180/Math.PI));
circle.rotation = degrees + 90;

I have added a mouse listener for movement to the circle mc and then checked if a button was down. On button down this code would be executed on enter frame. This code works but the main problem is that I want to be able to "pick the circle up" at any angle and rotate it. If I pick it up with this code the circle automatically rotates to 90 degrees.

View 1 Replies

ActionScript 3.0 :: Rotating Objects To Face Center?

Dec 14, 2009

All I need to do is rotate an object (which could spawn at any point along each of the four edges of the screen) so that it faces towards the centre of the screen. Obviously this will be done using the .rotationZ property. I will know the starting point of the object, and the centre point of the screen (400, 300). The object begins facing directly 'up' (e.g. if it spawned directly below the centre of the screen it would already be at the correct angle).

View 2 Replies

ActionScript 3.0 :: Rotating A MovieClip Around Its Center Using A Handle?

Nov 4, 2010

a movieClip that contains a polygon and some circles at the angles of the polygon. I want to use the circles as rotation handles.Now the code below works but it terribly, terribly slow.I've seen a couple of other examples of rotation using the mouse position, but I want the polygon to rotate via the handle; I think that means the angle of rotation needs to be updated each time the mouse moves.Is there a cleaner/more efficient way to do this?Also, this works only for one direction right now no matter the x/y direction you move the mouse.

public function mouseDownRotate(event:MouseEvent):void {
// get the global x and y of the dragged piece (offset so it looks like it's rotating around the polygon's center

[code]......

View 6 Replies

Actionscript 3 :: Rotating A Sprite Around Its Center Point?

Aug 9, 2011

I searched online and found this script that is supposed to rotate and image but I'm not sure how to use, where to put in the degree angle that I want my sprites to rotate by. Also, I get an error. 1084: Syntax error: expecting identifier before leftparen. 1084: Syntax error: expecting rightparen before leftbrace.

var point:Point=new Point(spr_box.x+spr_box.width/2, spr_box.y+spr_box.height/2);
rotateAroundCenter(spr_box,45);
function rotateAroundCenter (ob:*, angleDegrees) {

[Cde].....

View 1 Replies

ActionScript 2.0 :: Rotating A Loaded Movie In The Center?

Jan 27, 2006

I have spent hours trying to figure out how i could rotate a loaded movie through the centre axis rather than the set point set by flash in the left corner.

View 1 Replies

ActionScript 2.0 :: Rotating Dynamically Fed Photo Around A Center?

Sep 6, 2006

I'm doing a little photo rotation front-end for a site I'm working on. It's a custom photo gallery site that needs to have a photo rotation functionality to it. The back-end developers couldn't find a decent way to do it in Javascript, so they've come to me to figure it out in Flash.They pointed me to the Flickr rotation tool as an example. Seems like it should be straightforward:Load photo into empty movie clip on stageRe-center photo movie clip to the stageUse left/right rotation buttons to rotate image in 90 degree incrementsThat said, I'm having a tough time, after I load a photo into the empty movieclip, using a rotate left and rotate right button to spin the photo around. Obviously, the registration point is in top-left corner of the photo movieclip when the photo is loaded.

I've read that rotation can be managed by putting the clip to be rotated into an outer clip, but...there's a catch......I won't ever know what the exact size of the photo being loaded is going to be, so I can't set the outer clip to a certain size. I only know that it will never be wider than 100px.

View 3 Replies

ActionScript 3.0 :: Rotating Point Around Center Of Circle

Mar 9, 2009

I am trying to rotate some points around the center of the circle(0,0), however I'm getting weird values from the output. I've commented the problem code..

Code:
var r:Number = 10;//radius
var y:Number;
var x:Number;
var a:Number = 90;//angle of which the semi-circle is facing.. could be a random angle.
var ax:Number;//rotated points
[Code] .....

I am using the semicircle in BitmapData collision checking with getPixel(), with a moving circle...

View 1 Replies

As3 :: Flash - Rotating Image And Then Moving X And Y Relative To Center?

Feb 21, 2011

I am in the midst of finishing up a design application where you can upload images and colors. I use the greensock transform manager. I am taking anything a user does and recording it so I can recreate what they made on larger scale behind the scenes (to be exported for printing purposes)

The problem I am running into is with rotation and moving x and y values. The transform manager does everything relative to a center point, but when i recreate the image object the registration point is at the top left. I have found how to rotate around the center of the object using the transform matrix, but I can't seem to move the x and y correctly because these values change when you rotate. I want to just move the image to the left or right relative to the center. How could I go about doing this.

Here is how I rotate.

private function rotateAroundCenter (ob:*, angleDegrees:Number, ptRotationPoint:Point) {
var m:Matrix=ob.transform.matrix;
m.tx -= ptRotationPoint.x;

[Code]....

View 1 Replies

Actionscript 3.0 :: Dynamically Generated Objects Rotating Around Its Own Center?

May 12, 2009

i have a triangle that i generate using the following code:

Code: Select allinternal function generateTriangle(w, h, topPoint, color = "0xFF9900") {
var triangle:MovieClip = new MovieClip();
with (triangle.graphics) {

[Code]....

I use this function and a foreach loop to generate 9 differently colored and sized triangles, which works fine when i place them on the canvas. But if i try to rotate them they rotate around the 0,0 point - i want them to rotate around the center of the individual triangles, how do i do that?

1. How do i move a dynamically generated triangle inside a movieclip? Solved using [URL]

2. How do i access each of the triangles inside the movieclip, or even better, place them in 9 different movieclips using addChild so that i can move them around individually?

View 4 Replies

ActionScript 3.0 :: Rotating Around Center Point While Updating .x & .y Properties?

May 27, 2010

I want to be able to rotate the ship around the center point and be able to update the .x and .y at the same time.I've got this two versions of code.1

Code:
if (aKeyPress[38])
{

[code].....

View 2 Replies

ActionScript 2.0 :: Stop Rotating Around A Common Center When The Mouse Leaves The Stage?

May 4, 2010

[URL]I'm using this code and I made some changes like freezing the rotation when the mouse is over the rotation entities. But I'd like to stop rotation when the mouse leaves the stage. How can I do?This is my code

Code:
import flash.filters.BlurFilter;
import mx.transitions.Tween;
import mx.transitions.easing.*;

[code]....

View 2 Replies

ActionScript 2.0 :: Pausing Flash - Setting Delay Between Duplicated MovieClips

Mar 29, 2007

Im writing an application that parses xml to display a menu system in Flash. The same loop that grabs the xml creates a new movie clip for each node(menuitem). I need to set a delay between the duplicated movie clips so they appear one after another rather than all at the same time. Ive tried a few different things (interval and timer) but havent got it to work.

Code:
var item_spacing = 60;
var item_count = 0;
var item_count_next = 0;
var newy = 0;
_global.itemNumber = "";
function CreateMenu(menu_xml){
[Code] .....

View 2 Replies

ActionScript 3.0 :: Arranging Movieclips On Z Axis?

Mar 28, 2009

I know it's something to do with addChild() and addChildAt() but I don't understand how to get it working as the overlay mc is in the library and the slideshow is dynamically generated ..

Code:

package {
import flash.display.Sprite;
import flash.events.*;

[Code]......

View 1 Replies

AS3 :: CS4 - Rotating Text Mc On Y Axis Makes The Text Fuzzy

Sep 29, 2009

I have a dynamic textbox, left justified, characters embedded, set on whole pixel x and y, 266 wide and 310 high. I then made that into a movieclip with registration at the center. I then use code to flip it on the Y axis. The text is clear before the first flip when you test the movie. Flipped 180 on the Y axis so that it is backwards it is fuzzy. Flip it 180 again so it is back in its starting position it is still fuzzy. I have tried doing it without code, just flip by entering a value in the transform panel for the Y axis, it still goes fuzzy.

I need the text on the backside of my panel to be clear. go here to see the full panel in action [URL] click through to "work" on the menu. I am attaching a very simple FLA with a flipping textbox mc and a plain textbox on stage to show how the text should look

View 1 Replies

ActionScript 2.0 :: Method Of Rotating Multiple Movieclips?

Oct 14, 2008

The section in my code that does the rotating is in _root.onEnterFrame. Each movieclip is moved up/down an notch at a time within a 'for' loop. this loop is within a larger 'for' loop depending how many catagories to move up/down. I shall include this section of code for; i hope, better understanding

View 2 Replies

Actionscript 3.0 :: High CPU Usage When Constantly Rotating Movieclips

Feb 24, 2009

I'm working on a new site and one of the things the client likes most is the idea of these gears that are constantly rotating on the screen. However, now that I have the mock-up design done, I'm noticing that the constant rotation requires a lot of CPU to maintain. Has anyone else experienced this and have you figured out a better method than the one I am using to rotate the movieclips?

[Code]...

View 2 Replies

ActionScript 2.0 :: Creating Infinitive Effect By Rotating MovieClips

Mar 23, 2006

If I click on mc1, then mc1 has to go to the position of mc3, mc3 has to go to the position of mc2. The same thing must happen when I click on mc2, it has to move to the position of mc3 and mc3 has to move to the position of mc1. I would like to create some kind of infinitive effect by rotating the mc's. In a later stadium I want to fill the mc's with pictures.

View 2 Replies

ActionScript 2.0 :: Create A Movie Where Several Movieclips Move Towards The Center Of The Screen?

Aug 23, 2009

I am trying to create a movie where several movieclips move towards the center of the screen and organise themselves. I havve the following code attached to the timeline, the clips move ok but dont interact.

Code:
target_mc = ["mc0", "mc1", "mc2", "mc3"];
movement = function () {
numMcs = target_mc.length;

[code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved