Rotation of the object

Hey guys,.

I am trying to rotate an object using:

private var object:Image;
object.rotation = -7;

but he turns it around the coordinate 0,0 but I want to turn across the width/2, height/2 coordinated - which means in the middle of the object. is this possible?

No, I'm not buying a case dethrone oh wait... omg!  It is a matter of real Director!  * surprised *.

setting the point of registration for a display object is quite possible.  Here is an example for registration point in the center of a square graphic.

var squareSize:uint = 100;

var square:Shape = new Shape();
square.graphics.beginFill(0xFF0000, 1.0);
square.graphics.drawRect(-squareSize / 2, -squareSize / 2, squareSize, squareSize);
square.graphics.endFill();

square.x = stage.stageWidth / 2;
square.y = stage.stageHeigh / 2;

If you do not have access to your object, drew such a bitmap that has always a {0, 0} record, you can place inside a displayObjectContainer (sprite) and rotate the container:

var container:Sprite = new Sprite();
container.addChild(object);

object.x = -object.width / 2;
object.y = -object.height / 2;

container.rotaion = -7;

If you prefer not to use a container to the Center-register your bitmaps, it is possible to use a matrix to translate your BitmapData when you draw() to a Bitmap.  It's a little more confusing than the use of a container, but it some cases that it is worth.

[EDIT] Furthermore, my sarcasm wasn't all directed at you, bba.  Thanks for your question.  seriously.

Tags: BlackBerry Developers

Similar Questions

  • Rotation tool - how to change the degree of rotation once the object has been rotated

    Hi all

    I searched the forums and on the web for this answer - maybe someone can help you.

    Please see attached Image:

    Illustrator.PNG

    When you use the rotation tool is at - there a way to change the degree of rotation, once the objects have been rotated. For example, I first selected 20 degrees and repeated step rotation, but I would like to change it to 40 degrees. Currently, I have to remove and re do the rotation. Is there a more effective way around that?

    Thank you

    Darren

    Darren,

    You can opt for effect > Distort & Transform > transform, possible monitoring of object > decompose the aspect when you're sure (more than).

  • Click, animate the rotation of the object of + 90 ° using AS3?

    I have a button that will rotate an object to its parent of 90 degrees each time its clicked:

    b_rotate_CW.addEventListener (MouseEvent.CLICK, rotateCW);

    function rotateCW(event:MouseEvent):void

    {

    Object (this).parent.module.rotation += 90;

    }

    Which is fine, but I think it would be a nice touch if the rotation of the object have been animated.

    I tried this:

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    Import fl.transitions.TweenEvent;

    b_rotate_CW.addEventListener (MouseEvent.CLICK, rotateCW);

    function rotateCW(event:MouseEvent):void

    {

    var rCW:Tween = new Tween (object (it).parent.module, "rotation", Strong.easeOut, 0, + 90,.5, true);

    }

    ... but there is no nothing, I'm guessing that "rotation" is an option transaction, I can't find any documentation for it, only x, y, their scale and alpha.

    I'm sure this has been done by many, can anyone offer a useful clue as to how this function would be coded correctly?

    Thank you!

    It's great, I tweaked a bit; replaced the 0 with the current angle of the clip) and now it works perfectly:

    var rCW:Tween;

    b_rotate_CW.addEventListener (MouseEvent.CLICK, rotateCW);

    function rotateCW(event:MouseEvent):void

    {

    rCW = new Tween (object (it).parent.module, "rotation", Strong.easeOut, objects (EC).parent.module.rotation,.parent.module.rotation of the object (this) + 90,.5, true);

    }

    Who knew you can use target a path instead of the value?

    Where everyone can learn AS3 as you know?

    Thanks again for your tremendous help!

  • His cheek until the object is to stop turning

    I object of film clip with the name "ratas.

    And I have the script to run. Then I press the button of the mouse, and I simply hold down the mouse button "ratas" begins to turn with increase in speed, then I release the "ratas" mouse button stops spinning with the decrease in speed.

    I want that "ratas" begins to turn and the music from the library starts to play... then "ratas" stops the sound stops too. But for this script, I have a few errors and I undertand where I make a mistake.

    The symbol "ratas", layer "layer 2", frame 1, line 58 1120: access of undefined property Channel. "

    Symbol "ratas", layer "layer 2", frame 1, line 58 1061: call to a method maybe not defined play through a reference with static type class. "

    The symbol "ratas", layer "layer 2", frame 1, line 64 1120: access of undefined property Channel. "

    var speed: Number = 0;

    var minSpeed:Number = 0;

    var maxSpeed:Number = 5;

    var increaseNum:Number = 0.05;

    var decreaseNum:Number = 0.02;

    var click: Boolean;

    var clickarea:Sprite = new Sprite();

    clickarea.graphics.beginFill (0 x 000000, 0);

    clickarea.graphics.drawRect (-500,0,stage.stageWidth, stage.stageHeight);

    clickarea.graphics.endFill ();

    clickarea.buttonMode = true;

    clickarea.addEventListener (MouseEvent.MOUSE_DOWN, downHandler);

    clickarea.addEventListener (MouseEvent.MOUSE_UP, upHandler);

    addChild (clickarea);

    function downHandler(e:MouseEvent):void {}

    clicked = true;

    }

    function upHandler(e:MouseEvent):void {}

    clicked = false;

    }

    stage.addEventListener (Event.ENTER_FRAME, enterHandler);

    function enterHandler(e:Event):void {}

    Ratas.rotation += speed;

    {if (clicked)}

    increaseSpeed();

    playSound();

    } else {}

    decreaseSpeed();

    stopSound();

    }

    }

    function increaseSpeed (): void {}

    Speed = speed + increaseNum;

    If (speed > maxSpeed) speed = maxSpeed;

    }

    function decreaseSpeed (): void {}

    Speed = speed - decreaseNum;

    If (speed < minSpeed) speed = minSpeed;

    }

    var myMusic:Sound = new tiktak();

    channel: var SoundChannel = new SoundChannel();

    function playSound (): void {}

    If (speed > 0) {}

    Channel = tiktak.play ();

    }

    }

    function stopSound (): void {}

    If (speed < 0) {}

    Channel.stop ();

    }

    }

    You have two totally different things you are trying to control. 1. you want the object to rotate and change its speed control such as a button is held down. 2. you want a sound to play as long as the object is rotating.

    You can start the sound and the rotation of the same event, the mouse down. The mouse upward you want the speed of rotation of the object to start slow, but you want the sound to continue until the object is not. If the ending sound is controlled by the rotation of the object, not the button press or release.

    To have the sound play only once, you must call for the sound to play only once. For the sound judgment to test to see if the object is still running or not.

    Here is how I changed your original code:

    The var speed: number = 0;

    var minSpeed: number = 0;

    var maxSpeed: number = 5;

    var increaseNum: number = 0.05;

    var decreaseNum: number = 0.02;

    var click: Boolean = false;

    var myMusic: Sound = new tiktak();

    Var channel: SoundChannel;

    var clickarea: Sprite = new Sprite();

    clickarea.graphics.beginFill (0 x 000000, 1);

    clickarea.graphics.drawRect (-500, 0, stage.stageWidth, stage.stageHeight);

    clickarea.graphics.endFill ();

    clickarea.buttonMode = true;

    clickarea.addEventListener (MouseEvent.MOUSE_DOWN, downHandler);

    clickarea.addEventListener (MouseEvent.MOUSE_UP, upHandler);

    addChild (clickarea);

    downHandler function (e: MouseEvent): void {}

    clicked = true;

    playSound();

    }

    upHandler function (e: MouseEvent): void {}

    clicked = false;

    }

    stage.addEventListener (Event.ENTER_FRAME, enterHandler);

    function enterHandler (e: Event): void {}

    Ratas.rotation += speed;

    If {(clicked)

    increaseSpeed();

    } else {}

    decreaseSpeed();

    }

    }

    function increaseSpeed(): void {}

    Speed = speed + increaseNum;

    If (speed > maxSpeed) speed = maxSpeed;

    }

    function decreaseSpeed(): void {}

    Speed = speed - decreaseNum;

    If (speed< minspeed)="" speed="">

    If (Channel & speed == minSpeed) {}

    Channel.Stop ();

    }

    }

    function playSound(): void {}

    Channel = myMusic.play ();

    }

  • Is it possible to create an object in rotation in the Muse?

    Is it possible to create an object in rotation in the Muse? I have a round logo and I not want to turn.

    Hello

    If you are looking for a logo that rotates 360 degrees, it is not possible in Muse. You can create an animation in animated border and import muse Adobe animation.,.

  • Find the angle of rotation of the anchored object, replace that specific object by letter

    I got indd file customer. General problem is that he described certain letters of the words.

    In fact, he described the letter e and that it rotates 180 °. It also makes with the letter c and there a rotation that anchored-178, 8250 ° oppose.

    Now, I tried to change this objects to the real letters. Problem is that I can't find the option for the rotation of an object in the Find/Replace dialog box, and also I can't fint in Grep. So, what are my options?

    Thanks in advance...

    PS. If there is a possibility to change one of them, I can change a second with finding anchored object and change it to specific letter...

    Looks like someone could not find the real schwa or o open on their keyboards

    Possible, but tricky.

    This Javascript will search history containing the text for items cursor which rotated 180 degrees and replace them with a question mark. Replace the question mark with the character really wanted in notation Unicode Javascript ("\u... ("-here character four-digit hexadecimal code).

    It really isn't a good way to check if it really is one that you should be replacing, so it does not blindly on all 180 degrees of rotation objects...

    (You can simply change the "180" to your another number to check the other characters).

    all_text = app.selection[0].parentStory;
    
    for (thingy=all_text.allPageItems.length-1; thingy>=0; thingy--)
    {
         alert (all_text.allPageItems[thingy].rotationAngle);
         if (all_text.allPageItems[thingy].rotationAngle == 180)
         {
              all_text.characters[all_text.allPageItems[thingy].parent.index].contents = "?";
         }
    }
    
  • comparison qeustion models: when the unit is not perpendicular to the object

    Hi all

    I m new in OR vision. I have already created a program for pattern matching and hoping to get the angle of rotation.

    My problem is: when the subject turns in any higher than 20 ° angle, I can't get an accurate angular measurement.

    I assumed it might be because my camera was not perpendicular to the surface of the object. anyone of you nice guys could give me some advice please.

    Thanks in advance

    Just use the arrow as a generic object.  Place a fiduciary are in it and find the relationship between the arrow and the alignment.  I edited your photos to place a hole in the top of the arrow.  The VI concludes the arrow like a bright star.  It uses the bounding box as the search box to find the hole.  The center of the arrow and the center of the hole form a line pointing in the same direction as the arrow.  The VI and sample images are attached.

  • Why my boss is not the object to which I assign?

    I'm working on PC, Windows 7, Illustrator CC 2014. I created a template by following the instructions on this site and in a video, and it does not work. The model is to repeat lines of alternating colors.

    (1) I drew my lines, copied and pasted alternating and aligned.

    (2) I've drawn a bounding box so the lines are found in the bounding box. I send the bounding box for the back and don't assign any line.

    (3) I have a repeating pattern odd when I assign to a rectangle.

    Pattern try.jpg

    What I am doing wrong? I need it to look like number 2 looks.

    Thank you.

    Always create a model that uses vertical or horizontal lines. Then apply to the object. Then rotate the model with the rotation tool, or transform Panel. When checking option to turn only the model not the object.

  • Find the edge of the object in After Effects

    Hello

    first of all, I'm sorry if the answer to my question is already posted somewhere... I'm a little confused, I did not only find one somewhere in the web already - don't know if I may search for terms good or if it's really such a special question, I...

    Anyway, my question is: How can I get the coordinates of all four edges of the objects (images) in a three dimensional composition in After Effects? And also, is there a way to see the real coordinates of the camera that I have proposed by several same-sex objects?

    In this case, it could be interesting, here is a more detailed description of my situation: I did a little three-dimensional composition in After Effects with images scaling and rotation one a mobile camera. I want to show the composition in a Tablet app and my first plan was to make and put the film in the app, but now my programmer and I think it might be better to generate the component directly in the app. So my programmer needs the coordinates of said to rebuild the composition in its code (as far as I know, using Xcode and wrote the app in Objective-C).

    Hope you guys can help me...

    See you soon!

    Theo

    (I use after effects on Mac OS X 10.9 CC.)

    Layer space transforms

    Everything you need to know (with a bit of additional reading upward using EI...).

    Mylenium

  • AS3 to get the position of the object in the other object

    Please I need help, I have an object inside this object I have other objects, (MC. Part1, MC. Part2, MC. Part3... etc), the MC spin in the stage, thanks to the tween, flash tools, it's ok, the parent of the object rotate and the child with him, but I want to get the child (MC1 coordenate. Part1.x, MC1. Part1.y, MC1. Part1.z, etc.), I try with trace (MC1. Part1.x) and always give me the same coordenate, I think that the coordenate in the parent, but I want the coordinates of the child when the parend is running.

    Please help me

    The coordinates of the child objects do not change compared to the parent who keeps them if the parent is moved, then they will report the same values all the time.  If you want to know the location of the main stage, you must use the localToGlobal() method.  Try Google search using terms like "AS3 localToGlobal tutorial" for an explanation of how to use it.

  • Transformation/rotation of the adjustment layer matrix

    Hi all

    I "is working on a plug-in of the CEAP to transform keyframe on the layer. I have a sequence of 3D rotations stored as quaternions and I would like to convert it into orientation keyframes (or rotation). Conversion of quaternions to Euler angles is not acceptable in my situation, because due to the multiple possible solutions/angles for the same 'pose', the object tilts during the animation. The SDK Guide also specifies that the Orientation using quaternion, but I don't know how this can help me.

    Any ideas?

    Thank you

    Edit: this thread http://forums.adobe.com/thread/1142672?tstart=30, it looks like what I'm looking for is not possible:

    (shachar carmi):
    an effect, nor a CEAP can change the transformation matrix. they can only change the param values.

    Post edited by: cbmb

    I solved my problem by using a function atan2 custom in my routine of Euler matrix and be converted to keyframes of rotation (X, Y, Z).

  • Inherit pivot of the object?

    OK, that's a weird topic, but I'll do my best to explain what I am hoping to do.

    Inside 3D Studio max, its possible to adjust the center of rotation of an object anywhere in space. So for example, if I have a sphere in my scene, and I want to have a bunch of cones rotation around the center of the sphere (to create the basic shape of a graph of Sun), I can just change pivot of the cone to be in the exact Center of the sphere, and then when I turn and copy the cone, they are all perfectly centered around the sphere.

    Binder to do this in Photoshop however is rather difficult. Since the triangle representing the Sun's rays is smaller than the circle representing the Sun, I can't move the own pivot to match the center of the Sun because the bounding box for the transformation is not large enough. If I have the Sun duplicate and merge the triangle and the Sun together, the action of fusion readjusts the pivot to be at the center of the two objects so its is no longer in the center right of the circle. I can however move the pivot point at the approximate location now because the bounding box is bigger, but I don't need the approximate location, I need the exact location.

    Is it possible to move the pivot of specific coordination? Or I have to spend all on a canvas perfectly square and draw everything to the lines of the grid?

    I just want to know an easier way to do this for the future. If it's not supposed to, I can make a video.

    Enter the transform mode. Drag the pivot where you want. If the bounding box is a small width or height and keeps you drag only the pivot hold the Alt/Option key, and then drag the pivot. If you drag the pivot is not at the center of bounding box or on a stick then no point no is highlighted in the proxy in the Options bar and you will be able to enter the coordinates in the fields X and Y of the Options bar for precise positioning of the pivot.

  • The scaling and rotation with the motion tween

    This is a ridiculously easy problem but I paint a mental space to how to do this in advance I apologize for simplicity. I'm trying to get a clip to rotate and to scale automatically without be clicked. I would like that it gradually rotate 90 degrees and scale by 150%, but I can not find a way to get a motion tween, to do and am having to do it manually frame by frame. What is the code for this?

    Thank you!

    If you are using CS4 or later, make sure that you use the classic Tween to what you call, you tried. Asked only that I have, it's mention you a clip twice... If you are inside the movieclip you cannot rotate and resize it from there.  So is there a clip within the clip, and this is the internal clip you are trying to tween?  The object you to scale and rotate should be a symbol in the library.

  • Problem with the image change when the object hit an object...

    Im making a small application lite flash... it will actually be a game...
    So theres 2 parts, a part that turns then his press down and the other part which checks if the spinning part touches the part. When I rotate the object and it touches the square, it prints out they collide, but after the thing printed, I gotoAndStop (45);  What does not work? the text appears, but it will not change framework?

    The question remains... What is supposed to change the settings? What is "sound"?  For the code as show you, the object with the planted on that code will be gotoAndStop (45).  If the main scenario is 'His' then you must target as you did the other objects.

  • How drag and drop a picture into a shape of the object?

    On my old Lion system that I used to be able to drag a picture from iphoto in the shape of the object open in Pages.  I can't be able to do more.  The system changed?  I tried to use Inspector (under help), but it won't let me access the file of the photo on the right.

    You can drag and drop a picture in a form in v4.3 Pages ' 09, but this can be done in any version of v5 Pages. Quite different applications, as well as more recent Pages has lost about 100 features that were in its antecedent.

    Check if you have Pages ' 09 v4.3 in your Applications: iWork ' 09 file. If so, use it.

    Pages v5 requires that you select a shape, and then on the Image tab in the right panel, you choose Image, scale to fill fill, and then select your image for the background. You cannot select this image from the inside, but you can add text to the form that will appear on your image.

Maybe you are looking for

  • Satellite A40, running windows xp, webcam problem

    I have a webcam and a fujifilm finepix camera that can be used as a webcam. I can't work on my laptop. When the software is downloaded and it should start working the screen going blue with white writing, I can't read it because the laptop turns off

  • Satellite Pro2100: What Mini-PCI WiFi card?

    Hi people, I have a question about my laptop. I want to upgrade my laptop to the local wireless network with a Mini-PCI card. I have a satellite pro 2100 with celeron 2 GHz processor. And the mini-pci card is a desire to buy a: Intel Wireless MiniPCI

  • Locking the view from left to right on iPad, so can only scroll

    Hi all! Very new to all this.  I've done a few worksheets that I am very satisfied.  They consist of long lists of inventory and adjustments of table on the screen of my iPad perfectly from left to right.  All is needed is to scroll through hundreds

  • Faced with setting up a connection RS-485 for a for OR cDAQ mass flow controller

    I'm an absolute beginner from the ground up tries to connect the port RS-485 to a mass flow controller (MFC) Instruments Sierra for the NOR cDAQ. The planned route of the person in front of me set up for the connection is: (1) cable MFC COM1 to Inter

  • Cannot send/receive pictures via the BlackBerry Q10 Q10 blackBerry text

    Someone else do the new update and you are unable to send/receive pictures via text? I get an error "General problems" which tells me nothing. I've restarted and nothing works. I wish that I have never update could someone please help me. Thank you