How to rotate a movieclip clockwise and counterclockwise

Dear friends,
I have 2 movieclips. ro used for rotating and rect the movie that will be rotated.
I want when clicking and draging the ro movieclip clockwise or counterclockwise, the rect movieclip is rotated clockwise or counterclockwise respectively.
I allow the rect to be rotated according to mouseX and mouseY.
but it dose not work as I need.
I'd like you to show me a trick to achieve that as I want.
Here is the code:
var xPo:Number;
var yPo:Number;
ro.addEventListener(MouseEvent.MOUSE_DOWN, mouse_down)
function mouse_down(e:MouseEvent):void
     xPo = mouseX;
     yPo = mouseY;
     ro.addEventListener(MouseEvent.MOUSE_MOVE, mouse_move);
function mouse_move(e:MouseEvent):void
     if(xPo > xPo)
          rect.rotation += 10;
     else
          rect.rotation -= 10;
     ro.addEventListener(MouseEvent.MOUSE_UP, mouse_up);
function mouse_up(e:MouseEvent):void
     xPo = mouseX;
     yPo = mouseY;
     ro.removeEventListener(MouseEvent.MOUSE_UP, mouse_up);
     ro.removeEventListener(MouseEvent.MOUSE_MOVE, mouse_move);
Waiting for you help.

just checked it quickly and made a change here:
if(xPo > xPo)  to  if(mouseX > xPo)
this does the colckwise anti clockwise thing but not exactly. May be this would help you go ahead.

Similar Messages

  • How to remove a MovieClip symbol and stop it?

    I manually create a movieclip symbol and given instance name "Ball" on stage (not new MovieClip in AS), and it contained 20 frames animation, but after when I click a button to remove it "removeChild(Ball);", I don't know why it still running? although I can add a "stop()" code on 20 frame to stop it, but I don't think that is a good solution.
    I try to remove its Event.ENTER_FRAME, but I don't know how to do it? because I don't know its event function name.
    Could anyone explain it?

    I believe that in order to fully destroy a MovieClip (and allow it to be garbage collected) there must be no references to it, and it can't be doing anything.
    Here's what I tried:
    mcBall.stop();
    removeChild(mcBall);
    mcBall = null;
    I believe that destroyed the MovieClip. Can anyone else confirm this?
    Michael

  • How to rotate window media player clockwise or counter clockwise

    When I receive video , it is 90 degree off clock wise. how to rotate window media player clockwise or counter clockwise?

    Hello,
    These sort of questions belong in the
    Music, Photos, and Video forum on Microsoft Community.
    As the Microsoft Community is on a different platform, we cannot move the question for you.
    Once there, click on Participate near the top of the screen, and select 'Ask a Question' or 'Start a Discussion':
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Does anyone know if/how to rotate a video clip?  I shot it so that it is sideways on my computer screen and I cant figure out how to rotate it.

    Does anyone know if/how to rotate a video clip in iphoto?  I shot it so that it plays sideways on my computer and I cannot figure out how to rotate it.  Thanks.

    You can't do that in iPhoto. You'll need a video editor like iMovie for the job.
    Regards
    TD

  • I was painting in photoshop and accidently rotated all the layers and the canvas how do i realign it?

    i was painting in photoshop and accidently rotated all the layers and the canvas. how do i realign them?

    dubrox666 wrote:
    Image rotation works if the canvas isn't rotated, the canvas was rotated by acciedent (gesture on my tablet) and image roate dosen't fix the canvas when it is rotated, even my guides were coming in crooked, image rotate rotated my image but not the canvas, it happened to me again so i reverted to my previous save, even my instructor dosen't have an answer?!!
    Risto
    Good gracious.  It sounds like you were able to rotate the canvas a more or less exact multiple of 90° or you'd have spotted that it was skewed.  I just tried it using the r shortcut, and while it is doable, it is not particularly easy to rotate the canvas to a point where it could fool you.  What does surprise me, is that while the Options bar shows the degree of rotation while the r key is depressed, I could see nothing on the UI to tell me that the canvas was rotated.  That's something that you might want to start a thread on the Photoshop Feedback page.
    Photoshop Family Customer Community
    Anyway, Escape is the usual way to cancel rotate canvas.

  • How do I fix rotate issue with thumbnail and full size?

    When I look at photos in the thumbnail view the rotation is wrong. When I click and view the photo in full screen mode, the picture auto rotates. This is frustrating and I can't figure out how to fix the problem. I've taken a Youtube screen video to showcase the problem. Any suggestions appreciated!
    Video of rotate issue between thumbnail and full size:
    http://www.youtube.com/watch?v=W232rZ8Nt34&feature=youtube_gdata_player
    Thanks,
    Nitesh
    Using iphoto 11 9.2.1

    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Include the option to rebuild the thumbnails.
    If that doesn't help:
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  

  • How to rotate and transform art board using extended javascript

    1.How  to rotate artboard using extended javascript
    2.way to write code which will work similar to transform feature , in adove illustrator
    Thanks in Advance

    it is not possible to rotate an artboard in the UI, and there don't seem to be any transform commands for it at all in the JS reference, so I'd guess its not possible.

  • Please help how to save a movieclip in flash to svg...and how to retrive the saved svg to movieclip in flash?

    hi all
    please help how to save a movieclip in flash to svg...and how
    to retrive the saved svg to movieclip in flash?
    thanks

    Do you mean from flash in a web page or do you mean
    converting the swf file format (maybe with a decompiler or
    whatever).
    If you're meaning to do it from flash in a web page:
    You can't save a movieclip from flash to svg. You could
    perhaps record drawingAPI commands and create the appropriate svg
    output in an internal xml object which you then send to the server.
    But I don't know of any pre-built classes to do that (disclaimer:
    because I don't know of any doesn't mean they don't exist).
    Going from svg to flash is doing it the other way around.
    Converting the svg paths back to actionscript drawing commands. I
    think I've seen some examples of this online somewhere.

  • How do you make a movieclip display and play when click on a button

    I'm looking to have a movie clip pop up, play itself after a user clicks on a flash navigation button.
    (something like this???)
    message_btn.addEventListener(MouseEvent.CLICK, goMessage1);
    function goMessage1(evt:MouseEvent):void
        ???(play message movie clip here)???;

    How you code that depends a bit on how you design the movieclip.  You could make the movieclip have an empty first frame that it is stop()-ed at, and tell it to play() in the event handler function.  Or you could have the movie's visible property  initially set to false and stop()-ed at frame 1 and have the event handler set the visible property to true and tell the movieclip to play();
    The key is to have a plan where the movieclip is waiting to play and has an instance name assigned to it that you can use to command it to play when you want it to.

  • How to rotate document?

    Is ther a function to allow document view to be rotated?

    Currently, Adobe Reader Touch (Windows Store app with "Modern" UI) does not support page rotation.
    If you have a PC/laptop/tablet with an Intel-based processor running Windows 8 (as opposed to Windows RT), you can install Adobe Reader XI (desktop app with classic UI) and rotate a page by selecting View > Rotate View > Clockwise or Counterclockwise.

  • How do I manage 2 Ipads and 2 iphones on one ITunes account.

    How do I manage 2 Ipads and 2 iphones on one ITunes account.  Each device has a different name. But every time I plug them into iTunes on my Pc all the apps get screwed up. apps disappear etc.  I have "sync apps" selected without automatic updates. I'm thinking I should have this unselected, but that does make sense to me. Shouldn't I be able to have one iTunes account and manage each device independently.  What settings to do I need to apply to itunes so that every time i plug the devices in they don't get all messed up? thanks in advance
    Also, Iphone 4s is possible to rotate pictures without extra hassle of downloading software??

    You can try contacting iTunes Support and ask them if they can remove the balance from your account so that you can change countries : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • How Can You Disable Ease-In and Ease-Out Of Ken Burns

    It seems that along with everything else that has changed with iMovie version 10, when you add photos to the timeline it automatically places an ease-in and ease-out to the Ken Burns move.  For those of you who have been on a Mac for a while, this was how iMovie behaved in version 6 and earlier, and it feels rather dated.
    If you are putting together a video slide show with multiple photos back to back, having the zoom ease in and out for every image is incredibly obnoxious.  I can see situations when you are providing a narrative that it might be important, but often photos are just being animated to music.  Is there a way to disable the easing or am I just best keeping to iMovie 9.0.9?
    Thanks!

    Hi Douglas,
    Thanks for visiting Apple Support Communities.
    It does look like this is the default behavior for imported pictures in iMovie 10, and can't be disabled from the iMovie preferences. The best workaround is to select all of the pictures in your timeline and turn off the Ken Burns effect using the Adjust menu.
    iMovie Help
    http://help.apple.com/imovie/mac/10.0/#mov26d3f6a6c
    Modify a crop, rotation, or Ken Burns effect
    In the timeline, select the photos you want to modify or restore to their original state.
    Click the Adjust button in the toolbar.
    The adjustments bar appears above the clip in the viewer.
    To show the cropping controls, click the Cropping button.
    In the cropping controls, change Style from Ken Burns to Fit to display the pictures in their original size. From there, you can crop them individually as needed.
    Best,
    Jeremy

  • How to create a Custom UIView and How to instantiate that ?

    How to create a Custom UIView and How to instantiate that ?
    In Flash, all we need to do is create a MovieClip and assign it a class name in the library.
    Instantiation is a simple matter of:
    var newclass:CustomClass = new CustomClass({initialization_data:1652});
    addChild(newclass);
    At this current point in time, my understanding of creating custom UIView in xcode is limited to the understanding that you have to:
    1: Forward declare the class in the header.
    2:
    ]newclass *CustomClass in @interface's {}
    and THEN
    @property (nonatomic, retain) newclass *CustomClass;
    in the header file also.
    3: Nib initialization in the implementation file in viewDidLoad and do "addSubview".
    ==============================
    Based on my limited understanding at this point, I find the need to
    @property (nonatomic, retain) newclass *CustomClass;
    at the header somewhat limiting...as it denotes you must know how many instance you will create in the application before hand.
    I believe I am wrong here, hence, my question is, how do I add custom UIViews with initialization codes in real time ?

    hi,
    one workaround i could think of is using the CM views to search for content that belongs to a category and display it in a custom way.
    http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc904/wwsbr_api_view.html
    this only allows you to search for the meta-data available in the CM views but not the content of an item that is available when doing a search.
    in the next major portal release we will have a publich search API that can be used for these type of requirements. you can execute your search and format the results in the way you want.
    regards,
    christian

  • How to rotate a art board in a illustrator using adobe extended javascript

    How to rotate a art board in a illustrator using adobe extended javascript
    how to create mirror image of each textframe content of artboard

    1. there's no "Rotate" function, you have to rotate all your objects and then "resize" your artboard to simulate rotation.
    2. there's no "Reflect" function either, to make "mirror" images, use the ScaleMatrix function, see this post
    Reflect whole objects

  • How to rotate photos in albums?

    how to rotate photos in albums??

    yes, i can downloaded the photo(s) and use preview or iphoto ot some other program to rotate each one, but it seems so awkward, inelegant and SLOW, just to take a quick peek at the five separate photos that someone sends.
    is there really not an app or some similar thing to help?  i recall downloaded an app for explorer on windows, to take care of the same problem...

Maybe you are looking for

  • How do I non-destructively sharpen, re-size and save my images if I'm using both LR & CS6?

    Hi guys {and gals}...  Ok... here is my dilemma. I am having an incredibly difficult time understanding the best way to sharpen, re-size and save my images for both posting on the web and giving them to clients. I completed my first paid photo shoot

  • PDF files on mobile Devices with iOS and/or Android

    I would like to use PDF files (with embedded JS Code) on Smartphones and Tablets with iOS and/or Android. Are there Apps out there that not only display the contents (the "graphics") of the PDF file correctly but also execute the embedded JS Code pro

  • OS V5R3M0 : problem to connect

    Hi We have a "home application" which send and receive data with a R3 SAP system by RFC. The R3 system is on kernel 4.6D. We just apply SDKRFC 640 in our C server programme. It run good with OS400 V5R2M0 but wrong since V5R3M0 the log is : <i>[<i>i]*

  • Launchpad layout resetted after installing Netgear Genie. How to undo?

    After installing netgear genie my launchpad layout got resetted as if you buy a new mac, with on the other pages all other applications sorted by name. Really annoying. Cant find the .app of the genie app, the app isnt in the applications folder, now

  • What's a great, affordable Mini-DV camcorder to buy for Final Cut?

    I just got a MacBook Pro and Final Cut Express. What's a great Mini-DV camcorder to buy if I was to get my feet wet with video editing? I've just graduated from film school, looking to make short films and short documentaries. Does anyone know what a