A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Animation help

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Location
    Liverpool: UK
    Posts
    16

    Animation help

    Hi all,

    First Im a complete noob when it comes to Flash to apologies for anything I miss out. Thank you as always for your replies!

    Im hoping with help and a little bit of knowledge (very little) I can animate a clock so the big hand does a full trip round the clock...Thinking I can somehow strip out the big hand and make it an animation rather than static...suppose my first question would be is this possible?

    If so some tips or even a starting point would be greatly appreciated.

    the link below is to a clock very similar to the static image I have...as you can see its static at just before 2, id like to animate it along lines of every 2 seconds it goes round once to nearly 3, nearly 4 etc and just keeps looping till a user clicks on to the next slide?

    http://www.clipartof.com/portfolio/s...on-229934.html

    ****Using Flash 8****

    Thanks
    Last edited by adamc; 02-20-2012 at 09:20 AM. Reason: Added flash version
    ADAM C

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Just use Motion Tween with rotation, SAMPLE FILE

    On Layer 1, just replace it with your static image (after removing the hand on an image editor such as Photoshop), and then replace the Rectangle-drawn Hand with an image of the hand in the Graphic which is being Tweened
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Junior Member
    Join Date
    Feb 2009
    Location
    Liverpool: UK
    Posts
    16
    Hi Thanks for the reply that (amazingly) made sense even to me!

    What I actually ended up doing based on your reply was making a clock from scratch:
    Layer 1 Clock face
    Layer 2 big hand etc then tweened the clock hands.....

    Thanks for taking the time to reply, appreciate it.
    ADAM C

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    You can do all that with just one frame and code too.

    heres some examples

    Actionscript Code:
    //////////// If you want it to act like the second hand of a clock
    //////////// or hours, or minutes.
    onEnterFrame = function(){
        today = new Date();
        Hours = today.getHours();
        Minutes = today.getMinutes();
        Seconds = today.getSeconds();
        //myArm._rotation = Hours * 30 + Minutes / 60 * 30;
        //myArm._rotation = Minutes * 6;
        myArm._rotation = Seconds * 6;
        }

    //////////// Use this for smooth motion looping.
    onEnterFrame = function(){
        myArm._rotation +=1;
        }

    //////////// Use this for single frame. One complete turn.
    import mx.transitions.*;
    new Tween(myArm, "_rotation", None.easeNone, 0, 360, 10, true);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center