Rotation coordinates help

I have no idea how to explain this. I am trying to create a
movie that explains a bit about magnetism. I have 3 mc-s.
The first, MC1 is static. I want to use the dimensions of
this movie as constraints to the movement of a second movie.
the second movie MC2 should go no higher than the top of the
first mc or lower than the bottom of the same mc.
The third MC3 rotates, the speed of this rotation should
constrain how quickly/slowly MC2 moves.
it is set up this way.
MC1 does nothing.
MC2 starts in the middle of MC1 and moves to the topmost
limit
MC3 starts to rotate
by the time MC3 has rotated 90 deg, MC2 should be at the
topmost limit of the boundaries of MC1
MC 2 should then start to descend.
By the time MC3 is at 180 deg, MC2 should be back at the
centre
By the time MC3 is at 270 deg MC2 should be at the bottom
most limit of MC1
by the time MC3 is back to 0 MC2 should be at the centre of
MC1.
How can I programmtically constrain these things. I can do it
by tweening, but that's a pain in the backside and it isn't
scalable?
I hope this is clear.
Thanks
one mc that rotates around it's central axis. I have another
mc which should go up and down

Ok, I tried your "empty MovieClip" method, and it seems to work well. Please look at my code and see if I am doing it the most efficient way.
These are symbols in my library:
Clean (MovieClip) - Black stage sized rectangle to clear the buffer.
Square (MovieClip) - Blue (100x100) Square centered on the crosshairs (so it can rotate on its center)
// BEGIN CODE //
var bitmap:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,true,0xff000000);                    
var buffer:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,true,0xff000000);
var image:Bitmap = new Bitmap(bitmap);
addChild(image);
var clean:MovieClip = new Clean();
var container:MovieClip = new MovieClip();
var square:MovieClip = new Square();
container.x = stage.width/2-square.width/2;
container.y = stage.height/2-square.width/2;
container.addChild(square);
square.x = container.width/2;
square.y = container.height/2;
addEventListener(Event.ENTER_FRAME,onEnterFrame);
function onEnterFrame(event:Event):void {
    square.rotation+=5;
    buffer.draw(clean);
    buffer.draw(container, container.transform.matrix);
    bitmap.draw(buffer);
// END CODE //
A few questions I had about the code:
1. On "var square:MovieClip = new Square();" should I keep MovieClip like I have, or use Square?
2. If I make a Square.as file later, and have to use Square, do I retain MovieClip properties from my library symbol?
3. For memory management, do I need to set my MovieClips to null, or anything else like that in some finishing function?
Sorry about all the questions, I just want to get it right the first time. Thanks.

Similar Messages

  • Rotate screen - help!! N95 not 8gb

    When i play my music (and slide my phone down to do it), my nokia automatically rotates to landscape which is cool, but then when i close it it doesn't rotate back unless i slide up to reveal the keypad and then back down again. Now i have tried to download rotateMe using all this symbian signed business but have had no luck - i'm probably too thick in fairness! Is there any settings on my phone to sort it out so it goes back to portrait screen without sliding up and down? Or even better a freeware application which automatically turns to landscape and back to portrait when you turn the phone which unlike rotateMe you don't have to get signed????
    Thanks for your help
    Andrew

    28-Jul-2008 09:36 AM
    cjlim wrote:
    You don't need Rotateme for the N95 8gb because it has ASR built in. Goto Menu>Tools>Settings>Personalisation>Display Set Rotate screen to auto.
    Check the thread title mate.
    Grayburn @ www.nokiausers.net & www.dailymobile.se....come say Hello!!!
    If you appreciate ANY help from a member,then show it by clicking on the Blue Star button, cheers

  • Picture in Picture rotation - please help

    I am inserting a logo into the end title scene of an interview. The logo is Portrait but when I click the inspector for the logo picture to crop it, it only allows me to do so in Landscape (the box is Landscape). Can I rotate the box?
    Any help much appreciated, thanks!

    Hey Hannah320,
    You definitely can do this. If you click on the gear wheel on the clip, open up the crop tab. You will see a left and right arrow. Click on on one of those to flip the image to the direction you desire.
    Check out this site if you have any questions about that. http://imovietutorialhelp.com/how-to-flip-an-upside-down-movie-in-imovie.html
    It's a great resource for any iMovie questions. It answers this question as well.
    The iMovie Guy
    I may receive some form of compensation, financial or otherwise, from my video or link.

  • Rotated coordinates

    when i rotate an image how do i get the new cordinates of the image.
    This image is rotated around 0,0 but what is the coordinates of the other corners now it os rotated?
    img1.rotation=_angle;

    The new coordination after the rotation would be:
    x' = x*cosθ - y*sinθ
    y' = x*sinθ + y*cosθ
    So the AS equivalent would be something like:
            private function rotatedPoint(originalPoint:Point, rotation:Number):Point {
                return new Point(originalPoint.x*Math.cos(rotation) - originalPoint.y*Math.sin(rotation), originalPoint.x*Math.sin(rotation) + originalPoint.y*Math.cos(rotation));
    So Point(0, 20) after 10 degrees rotation would be:
    trace(rotatedPoint(new Point(0, 20), 10*Math.PI/180));
    // (x=-3.4729635533386065, y=19.69615506024416)
    Sounds about right...?

  • Polar coordinates help

    Ive been looking into polar coordinates for some time now, but i have little luck understanding what is actually happening.
    Im not particulalry good at mathematics (which i think is half the problem), but i cant seem to find any tutorials that sit down and actually tell you what the code is doing, usually its like this is program that uses polar coordinates heres the code....and i just dont get it
    do any of you know where i could find some decent tutorials on it?

    i learned it this year in my high school
    if you want i can explain it to you .
    the basics are those :
    try to imagine :
    if you stand in a room , and you want to go 5 steps to some direction , how whould you define it mathematicly ?
    thats what those equasions dos.
    the R is the 5 steps you want to go .
    the cos(angel) and sin(angel) are the direction for where you want to go.
    let me help you even more.
    i belive you want to create a game in which the object moves right ?
    so what you need to do is very simple .
    Point move(int direction){
    double x=cos(toRads(direction));
    //you give him the angel in int (45,90...)so its easier to debug
    double y=sin(toRads(direction));
    return(new Point(x,y)
    double toRads(int angel){
    return((angel*PIE)/180); //PIE is a final value in some class
    }now , you ask your self how do i know what is the direction ?
    well its very simple :
    class yourobject ...{
    int angel=0;
    final boolean RIGHT=true;
    final boolean LEFT=false;
    final int DEGREES_PER_TURN=5;
    void turn(boolean direction){
    if(direction)
       angel=angel-DEGREES_PER_TURN;
    else
       angel=angel+DEGREES_PER_TURN;
    now , if the user presses the right key button , you simply
    send the method turn the value right : turn(RIGHT);
    hoped i helped

  • Rotate me HELP!!!!

    Could any of you very helpful guys on this forum help me get a copy of rotate me signed?? I have looked absolutely everywhere and cant get it done, i know a few have helped others in the past, and was just wondering if anyone would be so kind as to help me on this one too?
    Please feel free to PM me i can provide my IMEI and email
    Thanks in advance
    Geof

    No longer possible to use SymbianSigned site to sign the application. The only way you can sign the application is with a Publisher ID. It appears that now Samir is the only person who can sign the application since when you try the SymbianSigned Online method it says that the email you entered (ie. your own) does not match the one associated with the embedded UID (ie. Samir's).
    I am sure if you paid Samir a fee he would sign it for you. So much for freeware. Its free to have the binary but if you want to run it then you have to pay.
    Looks like a great application, but totally useless if no one can actually use it. I am guessing this also applies to all the rest of Samir's applications which look great but I am sure the same applies.

  • Probleme rotation coordinate

    Hi everybody,
    I`m going to try to be clear, but I have juste one problem with the coordinate about a rotate rectangle.
    So, first I have this data, and when I put in Excel I have a right rectangle.
    SO now I know that I have to modify the data with the rotation, It`s what I did.
    It worked very well, I tried with graph and to modify the degree of rotation it was perfect I had good rotated rectangle.
    My next step and final step was just to put the coordinate on excel and reproduce the same rectangle on one graph in Excel.
    And it`s there that I met the problem.
    I have no Idea why, and I don`t see what to change to fix that......
    I now that just one rotation of 90 degree it`s enough to correct the position but where can I change something?
    If somenody know something about that or have the solution, you`re welcome.
    Sorry about this big post but I think is more clear with picture than more text.
    Thank you again for your answers (in advance)
    Maxime
    Solved!
    Go to Solution.

    Direction of rotation?
    In Excel, it looks like a postive rotation causes it to rotate clockwise.
    I didn't dig into your math, but in a lot of programs (like Autocad), a positive rotation angle is counter clockwise following the right hand rule.  Where 0 is the + X axis and a line from there rotates towards the + Y axis with a + angle.

  • Macbook zoom/rotating problem, help please!

    I have a macboook and every time I try to zoom in or out using my mousepad, my picture is rotated. How can I fix this?

    The Rotate gesture on a trackpad can be very close to the Zoom gesture. They both use a two finger movement. Since the Zoom gesture involves spreading or pinching your fingers, if you do not maintain a perfectly horizontal/vertical movement (i.e. one of your fingers moves either up/down/left/right instead of directly toward the other finger while pinching/spreading), the Rotate gesture will be reported by the OS to Photoshop Elements. As Barbara reports, you can disable this gesture from the System Preferences.

  • Rotating, need help with cos, and sin.

    I was reading through the fourmns and have learned that I need to convert to degrees. How do I do that? another issue is, the lines are plotted with INT values and can only be int. How do I do this with ints.
    Actually, I have a scale funtion I would like to be float, but the drawRect only accepts ints. Any way of doing this.
    Here is my code. How do I do this properly.
    thanks
    //gets the new points for the rotation. passing in degrees
         public int [] rotation(int vx, int vy, int d, Graphics g)
         //using this to pass the points I need to main
         int [] tp = new int [2];
             //[row] [col]
         int[][] TM = {{Math.cos(d),-Math.sin(d), 0},
                    {Math.sin(d), Math.cos(d), 0},
                    {       0,         0,        1}}; 
             int [][] Op ={{ vx, vy, 1}};
             int [][] TD = new int [1][3];
             //gets the X + TX // Y +TY and 1 value
             TD[0][0] = Op[0][0]*TM[0][0] + Op[0][1]*TM[0][1] + Op[0][2]*TM[0][2];   // {{TX}
             TD[0][1] = Op[0][0]*TM[1][0] + Op[0][1]*TM[1][1] + Op[0][2]*TM[1][2];  //   {TY}
             TD[0][2] = Op[0][0]*TM[2][0] + Op[0][1]*TM[2][1] + Op[0][2]*TM[2][2]; //    {1 }   
             //holds the new cordinate to plot using this cause I dont need the 1
             tp[0] = TD[0][0];
             tp[1] = TD[0][1];
           return tp;
        }

    yeah, here is an example the teacher had. His had 0, and 1's. Im not really sure about it.
    Every math teacher I had skipped trig stuff and cos, sin.
                                                                                              why again?
    | cos90    -sin90      0  |         | 100 |        0  -1   0     |100|      -200
    | sin90      cos90      0 |         | 200 |   =  1   0   0      |200|   =  100
    |   0                0          1  |         |   1   |         0  1    1     |  1   |          1yikes, nothing lined up!! sorry about that. Not sure how to fix it with this little window for edit.
    reilley35

  • Creating Rotating Banner HELP NEEDED PLEASE

    * Best software to create a rotating JAVA banner with *
    Hi
    Sorry if I am asking a really silly question. I've spent about an hour surfing the web for a clear answer but haven't come up with anything.
    I am having a W3C compliant website built and I need to create a JAVA/AJAX based image similar to how this works: [Gerrard Investments|http://www.gerrard.com/homepage.htm] but I don't have a clue where to start.
    What programme do I use to create something like that?_ Preferably I's like to use a freeware application, otherwise I have Photoshop, Fireworks, Dreamweaver, Frontpage should any of those do it. I'd really really appreciate any advice. Thanks for taking the time to read this. Regards.
    Edited by: Not4u2Touch on Jun 5, 2008 6:56 AM
    Edited by: Not4u2Touch on Jun 5, 2008 6:56 AM

    Not4u2Touch wrote:
    I am having a W3C compliant website built and I need to create a JAVA/AJAX based image similar to how this works: http://www.gerrard.com/homepage.htm but I don't have a clue where to start.
    You're throwing out words, but you don't seem to know what they mean.
    What programme do I use to create something like that?_ Preferably I's like to use a freeware application, otherwise I have Photoshop, Fireworks, Dreamweaver, Frontpage should any of those do it. I'd really really appreciate any advice. Thanks for taking the time to read this. Regards.That page used Flash. Anything wrong with that?

  • Rotating screen, HELP!!!

    Hi i have only had my nano for a week and already its driving me mad. everything was fine up until this morning, i went to play one of my games and the screen went mad and now its only showing half of what its supposed to. i havent dropped it or anything. i dont know whats going on.

    that happened to mine once. just press the menu and center buttons simultaneously until the screen goes blank and the apple logo appears. this takes care of most any problems you might have. it's very useful
    if that doesn't work, connect the Pod to the computer and click the restore button on the main iPod screen of iTunes
    Happy Listening!
    -MD55

  • Painting coordinates problem

    hi,
    i have noticed that when i put a picture like a JLabel in Jpanel the coordinates for the picture start from the left upper corner meaning:
    (0,0)
    -------------->x
    |
    | picture
    |
    v
    y
    how can i rotate the coordinates so it will b that y is facing up and x remain as it is?
    thx.

    thx, but that wasn't what i meant,
    when im painting in a picture using the repaint() method,
    if for example i want to draw an oval in (0,0),
    the oval will b shown in the upper left corner of the picture but i want it to b drawn in the lower left side of the picture with the same coordinates (0,0),and 4 that i need to rotate the picture coordinates somehow,
    the g.rotate() wont help because even if i rotate i will never b able to rotate it like i want in my first post(or i could b wrong?),
    thx anyway.

  • How to rotate objects?

    Extremely basic question I'm guessing.
    Simply need to rotate an object by a few degrees. Every time
    I do this the object increases in size.
    Don't want it to change size, just rotate.
    Help documentation didn't seem to offer any insight into how
    this works.

    I think my questions is even more simple than that...
    Not looking to have an object rotate, move, etc...
    Just placing things on the stage. Wanted a rectangle drawing
    object to be rotated slightly.
    Using the "free transform" tool causes the object to
    both
    rotate
    and
    increase in size.
    Is it possible to simply rotate an object on the stage
    (without doing anything else to it ... just rotate it)?

  • Cant restart MBP1.83 after installing AirPort Extreme Update 2007-001, Help

    Today I have installed that update on my macbook pro 1.83 mghz as the only update available, accordingly to apple software update utility. After a succesfull download and preinstallation, when I have restarted a lot of unix command lines appeared on a black screen. Then restarted again and the same thing happened (command lines stopping at a empty line). After a hard restart, the system tries to start but it stays on fisrt screen (apple logo with round timer keeping rotating).
    Help please!!! and be carefull anyone who tries to install this patch. Thanks!
    PS: I have tried disk check and permissions test and everything is ok, the problem continues
    Macbook Pro 1.83mghz   Mac OS X (10.4.8)   2Gb Ram

    You cant have a macbook pro 1.83 you must just have a normal macbook 1.83ghz processor. The lowest model of macbook pro has a 2.16ghz processor. I currently have a 2.0Ghz macbook core duo machine and after installing the airport update the machine restarted then came up with a dialog box instead of booting the os saying that i should do a hard restart in order for everything to work properly so once i did a hard restart by holding down the power button till the machine went off everything has worked fine so far.

  • IMAQ ROI rotated rectangle ANGLE calculation

    I am using IMAQ Construct ROI to construct a rotated Rectangle ROI. The resulting contours give coordinated of the top and bottom points of the rectangle before rotation and a fifth number indicate the angle. But can anyone tell me how can i calculate the angle in degree from this value, so that i can calculate the exact points of the rotated rectangle?
    Is there any other method to find the actual coordinates of the 4 edges of the rotated rectangle? My intention is to find some points in between these edge points, which i can calculated with simple trigonometry by knowing the angle of rotation. 
    Thank you in advance,
    Mathew

    The angle of rotation is about the center of the rectangle.  I think the angle is already degrees.  If you calculate the center of the rectangle and subtract it from the corners, you have the coordinates to be rotated.  The easiest way I have found to rotate coordinates is to convert them to a complex number, multiply the complex number by the angle IN RADIANS, then convert back to x, y.  Add the center of the rectangle back to the rotated coordinates and you are done.
    Bruce
    Bruce Ammons
    Ammons Engineering

Maybe you are looking for

  • Oracle 10g installation error in AIX 6.1 Platform

    Friends , While installing Oracle 10g (10.2.0.1.0) on AIX 6.1 platform ,I get the following errors : Checking operating system requirements ... Expected result: One of 5200.004,5300.002 Actual Result: 6100.01 Check complete. The overall result of thi

  • Using itunes playlist in slideshow

    I need to use a playlist as background music in an iphoto slide show. We have edited each the start and stop of each song in itunes using "get info" but those edits don't apply when imported into iphoto. Is there a way to make this happen?

  • Accidentally deleted Time Machine backups into Trash...

    I messed up big time -- I moved my Time Machine backups into Trash from Finder.  I've looked around online and it seems like I've really screwed myself over.  I can't reformat/erase the disk because I have about 1.4 TB of other material on it and I d

  • Is there a way to sort/filter hinting?

    I love the code hinting.. I'm just wondering if there's any way to make it sort or filter according to where the properties/methods are inherited from. For example if I type the name of a form on my page and gives a really long list, I would love to

  • 10.6.4 Update - 21.5" Imac no longer automatically sleep

    After installing the 10.6.4 update my 21.5" imac now no longers go to sleep automatically. Its set to 15 minutes and was working fine yesterday. Now it just goes to a screensaver. Anyone else got any ideas on how to resolve this?