Actionscript 2 help needed on rotating movieclip

I need help with the "stopping" of a movieclip rotation.  I think this would be easy for you Flash gurus but impossible for me.
Here is the description.  The code below shows a movieclip rotating after mouse click but i want it to stop in place after 60 degrees.  Basically I need it to rotate 60 degrees after every mouse click and stop.  The "trace" function is there so i know something will happen when it rotates a certain degree.  Right now it rotates continually after the mouse click.
mc.onRelease=function(){
     mc.onEnterFrame=function(){
          mc._rotation=mc._rotation+=10;
          if(mc._rotation==60){
          trace("HIT");
As a bonus i would like the rotation of every 60 degrees to ease in and out.  Thank you in advance for any help you can give me.

When the _rotation value reaches the 60 degree mark, you need to delete the onEnterFrame delete mc.onEnterFrame;.
There is only one position where the _rotation value will == 60, so if the intention is to stop it at every 60 degrees, then you'll need to change the conditional to be...
if(mc._rotation%60==0){
So....
mc.onRelease = function(){
     mc.onEnterFrame = function(){
          mc._rotation = mc._rotation+=10;
          if(mc._rotation%60==0){
             trace(mc._rotation);
             delete mc.onEnterFrame;
If you want to have easing, I suggest looking into using Actionscript tweening.  With steps of 10 there's little room to ease.

Similar Messages

  • Publishing/actionscript help needed

    Okay, first time poster and this is a complete newb cry for help:
    I had someone create a template site for me that is pretty simple - a single swf that pulls resources from a directory of xml files and assets. In theory, I should be able to update the xml for my site and provide new assets. Simple.
    I'm not a total neophyte, i know some code and within the xml there are some <font> tags that over ride the swf's formatting or provide and href. Again simple.
    My problem is that I now have to update our logo, which is hard coded into the source .fla file, which I know how to get in and swap out (the guy who did the work is not available). My problem is, when I publish, the new swf with the new logo does not want to read the <font> tags anymore. I have tried everything and I can't crack this. I've narrowed it down to two possibilities:
    1. Something in the Publish settings, though I've tried every conceivable variation to no avail.
    2. Something in the .as file that defines page template.
    I know I need to provide more info but this is a start. I'm working on a Mac (as was the coder) and we were both using CS4.
    Thanks for any and all help/direction.

    If your in the .fla, and you are simply swapping one symbol in the manner that your speaking, I would probably do a couple things, first I would make sure that the logo your swapping is the same type of object/symbol, same size is good, and then I would backup a copy of the original, and then delete the logo symbol and bitmap, import and name the new logo image the exact same as the other, and then convert it to a symbol with the exact same name as original, then either drag it to the stage in the layer and position it should be with the exact same instance names.
    I'm thinking in terms of a currently working product that I don't want to recode. So simply by taking a working one, and doing absolutely nothing more than changing the object, with everything identical, the code should do what it did before because all the actionscript instances, objects, var, event, and function names are identical, and therefore should use the proper instances at runtime.
    I think.

  • Actionscript help needed for website

    Hey everyone,
    I am just beginning to learn the basics of creating web sites in flash. I posted this in site design a while ago, but no one has responded yet and I need help asap.
    I have been following a tutorial and have it done pretty well, but they only cover one main button, and I am at the point where I need several more, but I am doing something wrong.
    The tutorial is at this page: http://www.flash-game-design.com/flash-tutorials/advancedWebsite-flash-tutorial- 3.html
    You can skip to the end and download the .fla if you want.
    What I want to do specifically is to add probably 4 other main buttons that can also have drop down menus. Please be as specific as possible because the extent of my code knowledge isn't very far.
    Thanks in advance
    The code for the main page is as follows:
    menu = ["About", "Bio", "Contact"];
    this.createEmptyMovieClip("content", 1000);
    this.attachMovie("sectionBackground","mask",1001);
    mask._y = content._y=208;
    mask._x = target=68;
    content.setMask(mask);
    content._x = -1000;
    imageScrollSpeed = 5;
    xStart = 125;
    yStart = 51;
    bWidth = 79;
    bHeight = 17;
    interval = 50;
    countDown = menu.length;
    menuOpen = false;
    theTime = 0;
    buttonScrollSpeed = 2;
    for (var i = 0; i<menu.length; i++) {
    var section = content.attachMovie("section_"+menu[i], "section_"+menu[i], i+100);
    section._x = section._width*i;
    var b = this.attachMovie("subButton", "subButton"+i, countDown);
    countDown--;
    b.stop();
    b._x = xStart;
    b._y = ySwtart;
    b.interval = interval*i;
    b.target = yStart+(bHeight*i);
    b.txt = menu[i];
    b.pos = target+(i*-section._width);
    b.onPress = function() {
      target = this.pos;
      closeMenu();
      this.gotoAndStop(1);
    b.onRollOver = function() {
      this.gotoAndStop(2);
    b.onRollOut = function() {
      this.gotoAndStop(1);
    b._visible = false;
    function closeMenu() {
    for (var i = 0; i<menu.length; i++) {
      var b = this["subButton"+i];
      b._visible = false;
      b._x = xStart;
      b._y = yStart;
    menuOpen = false;
    mainButton.onPress = function() {
    if (!menuOpen) {
      theTime = getTimer();
      menuOpen = true;
      for (var i = 0; i<menu.length; i++) {
       _root.main["subButton"+i]._visible = true;
    } else {
      closeMenu();
    mainButtoncopy.onPress = function() {
    if (!menuOpen) {
      theTime = getTimer();
      menuOpen = true;
      for (var i = 0; i<menu.length; i++) {
       _root.main["subButton"+i]._visible = true;
    } else {
      closeMenu();
    function scrollButtons() {
    if (menuOpen) {
      for (var i = 0; i<menu.length; i++) {
       var b = this["subButton"+i];
       if ((theTime+b.interval)<getTimer()) {
        b._y += (b.target-b._y)/buttonScrollSpeed;
    this.onEnterFrame = function() {
    content._x += (target-content._x)/imageScrollSpeed;
    scrollButtons();

    That's all AS2 code, so you'll be beter off posting in the AS2 forum.

  • Actionscript Help Needed

    So this is how it goes...I've already made my website, I have
    all the pages and everything made BUT...I have a few bugs. The
    first starts at my login page, it is a universal login, so it has 2
    usernames and passwords, I have the code for it but, It does not go
    when I press the submit button. The next is when I get to my actual
    website, all the webpages but one are all in different scenes. I
    type in the code: on (press) {gotoAndPlay ("1","Corp") ; } but it
    just goes the scene up next. I have no clue what is wrong here. I
    also have a flaw with my loading page, whether than just loads fast
    or not, the loading movie does not loop until the movie is loaded.
    This page is also part of the movie. Can anyone help? The web
    address is:
    http://www.freewebs.com/cliop/
    The code I am using on the button in my intro is:
    on (press) {
    if (username == "Cliop" or username == "X844495") {
    if (password == "*********" or password == "*********") {
    if (username== "Cliop" & password== "*********" or
    username== "X844495" & password== "*********") {
    gotoAndPlay("1", "Main");

    there's an actionscript forum for your issue. Better chance
    of getting help there.
    --> **Adobe Certified Expert**
    --> www.mudbubble.com
    --> www.keyframer.com
    Cliop wrote:
    > So this is how it goes...I've already made my website, I
    have all the pages and
    > everything made BUT...I have a few bugs. The first
    starts at my login page, it
    > is a universal login, so it has 2 usernames and
    passwords, I have the code for
    > it but, It does not go when I press the submit button.
    The next is when I get
    > to my actual website, all the webpages but one are all
    in different scenes. I
    > type in the code: on (press) {gotoAndPlay ("1","Corp") ;
    } but it just goes the
    > scene up next. I have no clue what is wrong here. I also
    have a flaw with my
    > loading page, whether than just loads fast or not, the
    loading movie does not
    > loop until the movie is loaded. This page is also part
    of the movie. Can anyone
    > help?
    >

  • Actionscript Help Needed Here!!

    Swuut up
    My Event Listener wont work once the thumb_mc has loaded the
    jpg... with this line commented out
    //thumb_mc.loadMovie("images/dj1.jpg"); it works !!...but then all
    im looking at is an empty movieClip that acknowledges when its
    being clicked! great but it would be even better if i could get the
    same result with an image loaded into the movieClip..mmMM.
    The Code is attatched. If someone can help me out id really
    appreciate it.
    thanx

    While I'm not going to post the working code for you, I can certainly point you in the right direction.
    Take a look at the class java.util.GregorianCalendar. It contains methods (some located in Calendar) to do manipulations with dates. You should be able to use the API to figure out how to create two GregorianCalendar objects... one with the current date, one with the due date. Once you've got those, there are plenty of methods to retrieve the day of the week, the date in the month, etc. which will guide you to calculating your answer.
    Excluding the weekends is going to be the trickier part, but then again, that's why it's your homework assignment. Try to get some code punched out, and if you have problems, come back here and post an exact problem, and someone will help out.

  • Actionscript help needed with getting Next Page to work

    I just have a simple question (hopefully).
    Question is:
    I have a web page that displays a flash file that zooms and
    pans, but I cant get the Next Page link to display. (will also want
    1st, last and previous page)
    1. Can the next page work and load the next or previous
    numbered file?
    2. Does it have to have all pages in one file, then it calls
    the next frame?
    Snippet below, or I can e-mail example files.
    Please help, Thank you, Mike
    ============SNIPPET==========
    <!--[if IE]>
    <object id="movie" type="application/x-shockwave-flash"
    width="300" height="500">
    <param name="movie" value="1.swf">
    </object>
    <![endif]--><!--[if !IE]> <-->
    <embed name="movie" type="application/x-shockwave-flash"
    src="1.swf" width="300" height="500">
    </embed>
    <!--> <![endif]-->
    <form name="f" onsubmit="return false;">
    <button name="button" onclick="next()">Next
    Page</button>
    <button onclick="zoom()">Zoom In</button>
    <button onclick="zoom2()">Zoom Out</button>
    <button onclick="pan()">Pan</button>
    <button onclick="setzoomrect()">Rect</button>
    </form>
    function next() {
    var flash = window.movie || document.movie; // Get Flash
    object.
    flash.Zoom(50);

    Use the same method you are currently using. The Zoom and Pan
    methods just happen to be exposed to the ActiveX control and
    Plug-in. So to use the the GotoFrame() method for example, just
    change your code from:
    function next() {
    var flash = window.movie || document.movie; // Get Flash
    object.
    flash.nextpage();
    To this:
    function next() {
    var flash = window.movie || document.movie; // Get Flash
    object.
    flash.GotoFrame(20); // This will jump to frame 19 of your
    main timeline.
    It goes to frame 19 because the method you are using is
    zero-based. Meaning to get to the first frame of your movie you
    would pass the number zero.
    To use the TCallLabel() method it would look like this:
    function next() {
    var flash = window.movie || document.movie; // Get Flash
    object.
    // to target the main timeline, use
    flash.TCallLabel("/", "labelName");
    // to target a movieclip on the main timeline use:
    flash.TCallLabel("/MovieClip", "lableName");
    Also, just so you know. These methods are getting antiquated.
    To keep up with the current versions and methods of communicating
    between JS and Flash you should really look into the
    ExternalInterface class in Flash 8.
    Tim

  • Website Actionscript Help Needed

    So this is how it goes...I've already made my website, I have
    all the pages and everything made BUT...I have a few bugs. The
    first starts at my login page, it is a universal login, so it has 2
    usernames and passwords, I have the code for it but, It does not go
    when I press the submit button. The next is when I get to my actual
    website, all the webpages are all in different scenes. I type in
    the code: on (press) {gotoAndPlay ("1","Corp") ; } but it just goes
    the scene up next. I have no clue what is wrong here. I also have a
    flaw with my loading page, whether than just loads fast or not, the
    loading movie does not loop until the movie is loaded. This page is
    also part of the movie. Can anyone help? The web address is:
    http://www.freewebs.com/cliop/
    The code I am using on the button in my intro is:
    on (press) {
    if (username == "Cliop" or username == "X844495") {
    if (password == "*********" or password == "*********") {
    if (username== "Cliop" & password== "*********" or
    username== "X844495" & password== "*********") {
    gotoAndPlay("1", "Main");

    I've tried a new code for my submit button:
    on (press) {
    if (username === "Cliop" or username === "X844495"); {
    if (password === "moocowman" or password === "shadowman"); {
    if (username === "Cliop" & password === "moocowman" or
    username === "X844495" & password === "shadowman"); {
    gotoAndPlay("1", "Main");
    else on (press){
    if (username !== "Cliop" or username !== "X844495"); {
    if (password !== "moocowman" or password !== "shadowman"); {
    if (username !== "Cliop" & password !== "moocowman" or
    username !== "X844495" & password !== "shadowman"); {
    stop();
    I still have problems, I type in the right username &
    password, yet I don't enter the website. It keeps giving me this:
    **Error** Scene=Intro, layer=otherpages, frame=212:Line 11: 'else'
    encountered without matching 'if'
    else on (press){
    Can anyone help me? I'm also still having problems with the
    navigation.

  • OnRollOver actionscript help needed

    Hi,
    I want to insert an actionscript that when the user rolls
    over an item, a movie clip shows up on screen at specific x and y
    positions. I have only basic knowledge of flash actionscripting and
    would appreciate any support. If someone could give me a basic
    outline of the code, then I will probably be able to complete the
    code myself.
    Many Thanks
    David Kelly.

    try:

  • Student Project - Need Help With ViewPlatform Rotation

    Hello folks,
    I'm a student in Strathclyde University, Glasgow, and I'm currently doing a small project for one of my programming classes. I'm doing a 3D knots and crosses game but I'm having tremendous difficulty getting the rotation to work just the way I want it to. Let me decribe what I need.
    Visualise 27 cubes, arranged in a 3 x 3 x 3 structure, space out slightly: a 3D knots and crosses setup. I'm trying to get the ViewPlatform to rotate around the central cube in a spherical fashion.
    I also need this rotation to use the keyboard arrow keys, not the mouse because I am reserving the mouse for interaction using the PickMouseBehavior class as stated in my project specification.
    I have looked up various classes in the API: such as KeyNavigator, OrbitBehavior, and some VisAd class that isn't included with the Java3D API nor is it on the systems I have available at the university.
    The trouble is, all these classes that I have found do not rotate the way I need them to: as described above. They "turn left" and "turn right" the camera as opposed to "rotate left around" and "rotate right around" the central cube (i.e horizontal rotation of the camera on a wide circle around an object).
    They also "move forward" and "move backward" as opposed to "rise up around" and "drop down around" the central cube (i.e. vertical rotation on a wide circle around an object).
    I have previously tackled this problem by creating a dummy cube under the central cube using then attaching the "camera" to the dummy cube in the DarkBASIC programming language and wonder if this method is available using Java.
    I've thought about defining my own arrow key rotation class, but I have little idea how to go about doing that either.
    An additional bonus would be the ability to limit vertical rotation so as not to go over and upside-down the vertical limit.
    Any help would be appreciated.

    I appreciate the answer and I know about implementing a Behavior to do this particular function of the program: is this what you are suggesting?
    If so, could you provide some clarity onto how go about implementing a Behavior to do the type of rotations I stated in my first post? By clarity I mean a little bit more about the recipe for creating a Behavior: the API is lacking documentation on this I think.
    I'll go do a bit of reading on it and tell you where I get. Nonetheless, any further advice would be much appreciated.

  • Interactive product photography - HELP NEEDED

    Does anyone know of a good tutorial that explains the
    photography process for creating 360-degree interactive Flash
    tutorials?
    I have several small sculptures I would like to photograph
    digitally, but could use direction on; lighting, number of shots
    needed for a smooth rotation, and tips on stitching the frames
    together.
    I would also appreciate any recommendations on authoring
    tools and final file formats - I'm currently looking at the
    "360-Degree Interactive Product Viewer, V1.0" extension.
    I will need only rotate and zoom functionality.
    Thanks in advance for your help.
    -Sam

    Hello
    You must not be nervous about it. Recovery procedure is simply to do and after 20 minutes only you will have clean preinstalled operating system with all necessary drivers.
    Only thing you must do is data backup.
    For outlook messages follow instruction given by Akuma.
    With favourites do you mean favourites in internet explorer?

  • Urgent Flash help needed; Using Movie Clip Objects

    Hello,
    I am currently trying to design a small flash movie.
    I have a "Movie Clip" object (a short animation) that i wish to act like a static object until a certain frame on the main Timeline.
    Then i want it to play out, at it's own pace, just like normal, until it finishes (no looping)...
    What do i need to put into, and where do i put it?
    So in short, frame 30 of the main animation triggers the clip, whilst the main animation still runs...
    I know very, very minimal AS3... so please, can someone help me?
    A lot of solutions suggest a button, but I don't want to use a button, as it's not interactive - just a movie.
    i just want the damn movie clip to play in the damn movie when it reaches frame 30! it shouldn't be that hard..

    There is most likely no need for any code. And most likely no need for a movieclip even.
    It sounds like you would need a graphic symbol. (You can convert it in the library or you can just change the instance you have placed on stage.)
    First select the symbol on its first keyframe and on the properties panel select the looping options and tell it single frame, first 1.
    Then move along your timeline to where you want the animation to start playing. Add a keyframe. Now select Once, first 1.
    Now it will start playing, you will be able to see it play as you scrub the timeline.
    If you use movieclips and code for this, you won't be able to see them play together as you scrub the timeline.

  • I need to rotate my text in pages - in a template - not just a text box

    I am trying to make labels in Pages using a template I downloaded from the place I bought the labels.  Problem is I cannot rotate the text! And I cannot select the text box - it is not working.  WHY PAGES WHY???? Does anyone know how to deal with this? 

    If you already designed a label art and need to rotate it to fit the label itself you can select all the elements from the design and select "group" then on the  "format" tab of the Inspector you can rotate it. If you wish to print more than one label just copy, paste and move them to the label area. Hope this helps.
    Can you also post a print screen so we can better understand what you are trying to achieve.
    Alex

  • Help needed for cylinder

    hi, im new to java3D and wondered if anyone could help me out with this problem.
    Im constructing a cylinder with its centre at (x,y,z) and aligned parallel to the Z axis.
    I want to change the orientation by rotating this cylinder from its centre so that it becomes aligned along the Y axis.
    can anyone show me the steps to do this?

    I know 3D graphics, but not Java3D.
    If you want to rotate any object aligned on the Z axis to the Y axis,
    then I think you need to rotate it 90 degrees through the X axis.
    regards,
    Owen

  • Need to rotate text 90 degrees in Numbers...any hints?

    Need to rotate text 90 degrees in Numbers...any hints?

    If you mean rotate text in a cell then this discussion may help with ideas to coerce Numbers to do what you want when it does not have the capability:
    https://discussions.apple.com/message/17454065#17454065

  • Troubleshoting help needed:  My iMac keeps crashing and restarting with a report detail: "spinlock application timed out"  What can I do to fix this?timed out"

    Troubleshooting help needed:  My iMac keeps crashing and restarting with a notice: "Spinlock application timed out"  What can I do?

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the page that opens.
    Select the most recent panic log under System Diagnostic Reports. Post the contents — the text, please, not a screenshot. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header and body of the report, if it’s present (it may not be.) Please don't post shutdownStall, spin, or hang reports.

Maybe you are looking for

  • Default vendor is coming in J1IG transaction while capturing excise invoice

    Hi, While capturing excise invoice at depot by using J1IG transaction, i am getting default custom vendor automatically. This is for STO transfer i am capturing excise. I have maintained some other custom vendor in the p.o. Pls. let me know from wher

  • HTTP to RFC scenario

    I have been trying to configure the XML to IDOC scenario given in the XI starter pack . Does anybody have the sample XML and XSD files mentioned in the scenario ? There are two messages in the XSD, purchase order request and purchase order response.

  • ERROR: NetExpress 5.0 path Not found - OUAF SDK 4.1 install

    I was finally able to install the SDK with all your help but now I am looking at another problem. In the installation document, after adding Eclipse it says: Start Eclipse by opening the Oracle Utilities Software Development Kit Client Scripts direct

  • OBIEE 11g : Report throwing TNS Error

    Hi, We have installed OBIEE 11g in Linux server. After replacing the Out-of-the-box RPD. The reports are throwing following TNS Error: Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65PState: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A g

  • Are DLL methods called as instance or static methods from Java ?

    Hi, I have only a small question. When I call a C++ DLL method from Java using JNI, do I instantiate it like an object method or is it called as a static method ? I am asking you this because I will use servlets (Java 1.2.2) to call a DLL. These serv