A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: MC animation forwards and backwards

  1. #1
    Junior Member
    Join Date
    Oct 2000
    Posts
    9
    I'm fairly new to actionscripting, but I just can't get a handle on this particular application.

    I have a main MC which targets another MC within the main. The targeted MC has a 40 frame shape tween in it. I want to control the shape tween with three buttons on the main MC (up, stop, down). I need to record the position (current frame) of the targeted MC. Please help an actionscripting initiate.

  2. #2
    Junior Member
    Join Date
    Aug 2000
    Posts
    24
    Howdy,

    It's quite easy to do. Make an instance of the MC and use this sort of action when the user presses the buttons:

    Stop:
    on (release) {
    tellTarget (instance) {
    stop ();
    }
    }

    Down:
    on (release) {
    tellTarget (instance) {
    prevFrame ();
    }
    }

    Up:
    on (release) {
    tellTarget (instance) {
    nextFrame ();
    }
    }

    As you can see you don't need to know the currentframe, but if you do want to know it, you can get it by using this command:

    instance._currentframe

    That's all

    I hope this will help you out,


    Laterz

  3. #3
    Senior Member
    Join Date
    Sep 2000
    Posts
    405

    check this out.....

    The code Luke posted will work but I believe it will only display one more frame when going backwards. To get a constant and controlled motion you'll have to create a simple loop that tells the MC to continue playing the previous frame as long as a condition is true....check this out http://www.blutimus.com/bgproject/history.html its an example of how to play a tween backwards and control where it stops as well as whether it plays backwards or forwards and can easily be modified for different conditions....let me know if it suits your needs and I'll give you the code
    Blutimus

  4. #4
    Junior Member
    Join Date
    Oct 2000
    Posts
    9

    Cool A little more advanced

    Thanks Lucky Luke...I got the MC working with the prev and next commands...It operates like a momentary switch right now. I need it to work with a loop so it will continuously go up or down until stopped or reach the end of the MC. Have any ideas...

    Blutimus that site is similar to what I want to accomplish, but how can I view the FLASH source code...It looks really good.

    thanks guys

  5. #5
    Junior Member
    Join Date
    Aug 2000
    Posts
    24
    Howdy,

    It will be quite more complicated if you need to use the loop, because you'll have to add a time delay between the actions, else the movie will playback to fast. I think I could make the .fla file for this effect, if you want to, I'll make it, just give me your email address. I'll have to take a closer look at it by making it myself

    Anyways, good luck with your movie,

    Laterz

    PS I just came through the tutorial section and I got this tutorial, you might wanna look it out:

    http://www.flashkit.com/tutorials/fx...e_rewind.shtml
    [Edited by Lucky Luke on 10-25-2000 at 03:08 PM]

  6. #6
    Junior Member
    Join Date
    Oct 2000
    Posts
    9

    thanks..

    If you want I can send you what I have already so you are not starting from scratch. Plus that way you will see exactly what I'm trying to do...

    you can also get me at astott@vimco.com.

    Give me your email address and I'll send you what I have.

    thanks again

  7. #7
    Junior Member
    Join Date
    Aug 2000
    Posts
    24
    Howdy,

    My email is Lucky_Luke2210@hotmail.com.

  8. #8
    Senior Member
    Join Date
    Sep 2000
    Posts
    405

    Here's the open source fla.....

    but I caution you! I had to change the contents since all the designs in the original were a clients and I replaced them with some really hideous pix of me! So be careful, lol! I think you'll see it's not really that complicated. If you need any explanation, contact me.
    http://www.blutimus.com/flash/backward_tween.zip

  9. #9
    Junior Member
    Join Date
    Oct 2000
    Posts
    9

    thanks

    thanks for source...I'll look it over and get back to you.

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