Skip navigation
Currently Being Moderated

3D animation plays in reverse ?

Jun 24, 2012 11:24 AM

I am trying to prepare a simple video of a book opening. You can see the file here:

 

https://docs.google.com/file/d/0B-cQQhdwl3C-b3JPYlM0SGZERnM/edit

 

If I scrub the timeline, the book opens as you would expect. However, when I test publish it, ir plays in reverse. Does anyone know why ? Incidentally, I put a stop action at the end to stop it looping. Any help would be greatly appreciated.

 

Regards,

 

TL.

 
Replies
  • Currently Being Moderated
    Jun 24, 2012 1:55 PM   in reply to Herugrim123

    It may have to do with the different objects you might be using, and possible the type of tweening (I have yet to use the new style).  What you should do is:

     

    - get rid of the animation you have on the stage now

     

    - take the movieclip of the closed book and adjust its position so that the left side of the image aligns with the registration marks

     

    - place that revised movieclip on the stage and assign it an instance name of "cover" in the properties panel.

     

    - place the following code in frame 1 of an actions layer:

     

          stage.addEventListener(Event.ENTER_FRAME, turnCover);

     

          function turnCover(evt:Event):void {
              cover.rotationY += 2;   // adjust value for speed or change frame rate
              if(cover.rotationY == 180) stage.removeEventListener(Event.ENTER_FRAME, turnCover);
          }

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 24, 2012 3:41 PM   in reply to Herugrim123

    There can be issues with timeline tweening regardless of which version of Flash you use.  Many veterans of Flash frown on the new style.   It is not a matter that they work incorrectly, it is a matter of how to make them work as desired... Folks seemingly have all kinds of trouble taming them based on what I've seen in these forums.

     

    As far as your problem with what you did in the file, that error is coming from the code you put inside the movieclip, not the code in frame 1 of the main timeline.  Get rid of the code inside the movieclip.  The code I provided belongs in the main timeline and will stop the book opening when it is opened all the way (when rotationY = 180).

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 24, 2012 5:03 PM   in reply to Herugrim123

    Yes old style = classic.  There are a couple of things they renamed as "classic" due to newfangled versions, but the classics still end up being prefered.  Too bad they tagged them that way because it does give a sense that they are outdated when they are not.

     

    Aside from the approach use in what I showed you, in Actionscript there is also the ' Tween ' class that you can make use of to manage animations.  In this case though, folks often resort to 3rd party tweening classes such as TweenMax/Lite due to better performance and control features.

     

    Unfortunately, most anything I know about Flash was learned either thru sweating thru it or in these forums trying to help people, so I cannot recommend anything to help you learn it beyond that... Dig in and lose hair, sleep, your mind, etc... 

     

    You could always start a new posting about learning materials.  Folks often ask about AS programming and I can only guess they get good info on what might be available.  Just copy your last paragraph into a new posting and see who bites.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 11:55 AM   in reply to Herugrim123

    You can/should keep all your actionscript in one place whenever possible, and in your case I see no reason why you cannot have it all in the same frame/layer.

     

    If you use the "cover" in that code, it is still trying to turn the cover.  You can probably reuse that same function for all page turnings as well.  Just change that function to be a little more generic and define the page that is to be turned....

     

          var page:MovieClip;  

     

          function turnPage(evt:Event):void {
                page.rotationY += 2;   // adjust value for speed or change frame rate
                if(page.rotationY == 180) stage.removeEventListener(Event.ENTER_FRAME, turnPage);
          } 

     

    Then you can have a new function that you call that assigns page to be the new object and sets up the ...

     

          function startTurning(pg:MovieClip): void {

                page = pg;

                stage.addEventListener(Event.ENTER_FRAME, turnPage);   // this starts the turning

         }

     

    And when you want to turn a page you call that function with the object's name as an argument.

     

          startTurning(cover);

     

          start turning(leaf1);

     

          startTurning(leaf2);

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points