7 Replies Latest reply on Jun 25, 2012 11:55 AM by Ned Murphy

    3D animation plays in reverse ?

    Herugrim123 Level 1

      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.

        • 1. Re: 3D animation plays in reverse ?
          Ned Murphy Adobe Community Professional & MVP

          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);
                }

          • 2. Re: 3D animation plays in reverse ?
            Herugrim123 Level 1

            Dear Ned,

             

            First of all, I am using CS5 so there can be no issues with the objects or type of tweening. Secondly, I tried your suggestion above but I received the following compilation errors:

             

            compiler errors.jpg

            I admit to being completely in dark about the black arts of action script ! It's possible that I've made some cardinal ( or even juvenile ) error. I have uploaded a new file with my attempt at your advice. You can see it here:

             

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

             

            Maybe you could have a look and see what foolish thing I've done ! I would also like to make the movie play once: I believe for that I need to add "stop();" into the last frame of the actions layer.

             

            Looking forward to your response,

             

            Regards,

             

            TL.

            • 3. Re: 3D animation plays in reverse ?
              Ned Murphy Adobe Community Professional & MVP

              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).

              • 4. Re: 3D animation plays in reverse ?
                Herugrim123 Level 1

                When you refer to the new style, does that mean that the "old style" was what it now names "classic tween" ? Because if it does, I'm right with you brother. I can never get those shape tweens etc. to work and always end up using the classic version. With regards to the AS you gave me, the file now works perfectly. All I need to do now is add some inner leaves to my book and try and copy ( with some alteration ) your script for those. As always, thankyou so much for your help.

                 

                Back when I was learning PS I went through loads of tuts and how to books which were all either too advanced or didn't forsee the sort of dumb errors that beginners get up to. Then I found Deke McClelland's "PS CS5 1 on 1" which is fantastic. Can you recommend anything similar for Flash ? If you can, I might conceivably leave you in peace !

                 

                Regards,

                 

                TL.

                • 5. Re: 3D animation plays in reverse ?
                  Ned Murphy Adobe Community Professional & MVP

                  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.

                  • 6. Re: 3D animation plays in reverse ?
                    Herugrim123 Level 1

                    One last question; if I create a new layer with an instance name "leaves" (which would be the inside of the book when it opens) can I copy and paste your code replacing the word 'cover' for 'leaves' into the same actions layer frame 1 or should I create a new actions1 layer and paste it in there ?

                    Update: I just tried both and neither work ! IE. the cover still turns but nothing happens to the second leaves layer.

                     

                    Regards,

                     

                    TL.

                    • 7. Re: 3D animation plays in reverse ?
                      Ned Murphy Adobe Community Professional & MVP

                      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);