11 Replies Latest reply on Jan 31, 2009 12:54 PM by dmurphy

    rotating an object in a banner

    dmurphy
      I have a banner and I am wanting to rotate one object. I want it to rotate slowly around and keep rotationing.

      Can some explain how to do this?

      Thank you
      Darlene D. Murphy
        • 1. Re: rotating an object in a banner
          clbeech Level 3
          increment the objects _rotation property using an onEnterFrame event, place this code in the first frame of the object:

          onEnterFrame = function() {
          this._rotation += 1; //clockwise rotation of 1 degree per frame (-=1 for CC)
          }
          • 2. Re: rotating an object in a banner
            dmurphy Level 1
            Thanks, I will try this.

            LadyDee
            • 3. Re: rotating an object in a banner
              dmurphy Level 1
              I am a newbie so, please forgive me. How do I save the script. The banner already has action scripts in it from the previous web developer, he made it so the words would blink. Now since he will not talk to us I need to know how to save this action and test it. I moved the peach into the word geOrgia. The O will be the peach.

              Thank you
              LadyDee
              • 4. Re: rotating an object in a banner
                clbeech Level 3
                can you post the file to a server for DL and post a link here - i'll take a look
                • 5. rotating an object in a banner
                  dmurphy Level 1
                  The files are at
                  Thank you
                  LadyDee
                  • 6. Re: rotating an object in a banner
                    clbeech Level 3
                    i was unable to get logged in - but it's just as well - you should delete the information form the above post as soon as possible, and change your password.

                    zip the fla files and upload them to your server, then post just a link to the address of the files - then they will DL.
                    • 8. Re: rotating an object in a banner
                      clbeech Level 3
                      got it :)

                      ok - I *think* what you're wanting to do here is a bit different than what I had told you. using the _rotation property would cause the image to move like clock hands turning about the z axis - i'm guessing what you want here is to rotate about the y axis, unfortunately in flash we can't really do that (expect in the new CS4 versions which does have some 3D manipulation control) but we can 'fake it' :)

                      we 'could' do it with AS, but it's just as well to use the timeline in this case. so using the assets in the file I created the clip for you, i also had to put it under a mask so that the image's bounds don't 'cover up' the letters on either side. There is also no need to load the image file, it's just fine (and small memory size) being embedded in the Library. so let's see if this is what you're looking for HERE
                      • 9. Re: rotating an object in a banner
                        dmurphy Level 1
                        That is exactly what I want to do in one banner. Could you please expalin for a newbie how to do this and save it. In another banner I wanted the peach to beach like a heart which is why I had the peach swf file included in the download. Could you please expain how to do that as well.

                        Thank you
                        LadyDee
                        • 10. Re: rotating an object in a banner
                          clbeech Level 3
                          LOL! you're welcome - it is already all set and saved within a single file, you can see if you double click on the peach MC how I constructed the timeline using motion Tweens - it's really not 'rotating' - it's 'scaling' from one keyframe to another from 100% down to 10%, then I 'flipped' it over using the Modify menu>transform>flip horizontal command (on a the next new keyframe) and the scaled it back up to 100% - rinse and repeat... lol - until you've gone both directions on both sides - then the clip simply plays continuously.

                          you would want to do the same thing for a 'heartbeat' type of effect - you can simply use scaling to scale up quickly like over just a few frames, drop back quick (couple more) then big again, and then smaller - so you get the thump,thump...(pause several regular frames)..thump, thump.. (pause) - and just let it cycle - so you really only need the thump, thump and pause parts once and it will play over and over. you would want to 'play' with the keyframe timing to get the 'look' you want.

                          to make a motion tween, you must use a MC symbol, place it on the timeline in the first frame, make a new keyframe a few frames down, then with that frame selected, use the scale tool to grab a corner and hold 'shift' to constrain it, and drag it to a new size. now select any frame between the two keyframes - right click and select 'create motion tween' (you can also do so from the properties panel combo box) and done! now you can scrub the timeline playhead to 'see' the action happening. you can also then 'adjust' the timing by dragging one of the keyframes to a different frame.
                          • 11. Re: rotating an object in a banner
                            dmurphy Level 1
                            You are so great. Thank you for taking the time to help a newbie in action scripts.

                            Thank you
                            LadyDee