Skip to main content
Known Participant
August 16, 2018
Question

making multiple movieclips stay in sync

  • August 16, 2018
  • 4 replies
  • 791 views

Colin, This sounds like what I need, but it is not working. I have seven planets circling a star and I need the inner planets to orbit faster than the outer planets, yet all twirl around at the same speed. I can't adjust the number of frames because then the fast planets disappear while the slow planets trudge their way around the sun. I tried writing the this.framerate=5; code but the only place I can find to do that is by double clicking on the movie clip and then right clicking on frame 1 inside the movie click to bring up the Actions panel. In Gory Greg's answer, he says to put the code outside the movie clip. Where? I don't see anyplace to use the Actions panel except inside the movie clip. Do these planets need to be graphic symbols instead? Is what I want to do even possible? Thank you for any help you can give me.

    This topic has been closed for replies.

    4 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    August 17, 2018

    Hi.

    Here is a suggestion.

    Probably not what you want but at least it will give everybody a starting point.

    My setup didn't require code.

    I created 7 graphics for each planet and put them in separate layers in the main timeline. All layers have a duration of 36 seconds minus 1 frame in the main timeline.

    Then inside of each Graphic containing the actual planet animation I extended the child timeline to a number of seconds that when divided by the total duration of the main timeline results in an integer number. In this way all the animations can loop seamlessly.

    To rotate the planets I simply moved the Transformation Point to the center of the stage and set the tween to rotate CW.

    And finally each planet also has a 360 degrees rotation animation of one second.

    I hope it all makes sense and that it can be useful for all of you.

    Regarding to Dreamweaver, export your animation as a OAM Package and you should be good to go.

    For responsiveness, the best you can do is to use the options available in the Publish Settings.

    Preview:

    FLA download:

    animate_cc_html5_planets_orbiting.zip - Google Drive

    Regards,

    JC

    ahuraniAuthor
    Known Participant
    August 17, 2018

    JC, That is exactly what I want to do. And cool, you even rotated the planets as they revolve around the sun. I also appreciate that you included the file you created. I will definitely look at that. It's amazing how fast a brain can delete information if it's not used. Like a hard drive. How long since I worked in that file? Ten years? Ah, delete it. Because of the help you and Colin have given me, I can now finish this job! Thank you.

    ahuraniAuthor
    Known Participant
    August 17, 2018

    PS: Don't you guys ever sleep?

    Colin Holgate
    Inspiring
    August 16, 2018

    Before getting into suggestions, do you need to use code to do what you want? Is it an animation of some number of planets orbiting a sun, that just repeats?

    ahuraniAuthor
    Known Participant
    August 16, 2018

    Okay, the big problem is that I no longer remember how to use Flash. It haven't worked in it since 2010. Your second panel helped to jar loose some memories. They're still a bit fuzzy, but I realize now I should be creating separate movie clips and not putting everything on the same timeline. I forgot that I could do that. Man! It has been years. Please remind me: do I control the speed of the movie clip not by the frame rate but by the length of the timeline?

    To answer your other question: yes, it is an animation of planets orbiting a sun that repeats. I tried making a css animation with the background and the planets on separate layers, but had trouble with the animation speed slowing to a stop before picking up again. Probably something to do with the planet layer being wider than tall and when it dipped off the screen, the animation sped up. It was also not responsive, the planets moving separately from the background, which made the sun no longer the center. I tried making a Photoshop animation, but there was no way to control speed at all. The planets zipped around like coffee addicts in the gif.

    So, Animate. I'm hoping it will work, although so far I have not been able to get it to show up in Dreamweaver. I used to copy code from the generated html file and put it in position, but so far I am having no luck. Maybe I need to rearrange my files and put everything at the root? That kind of rings a gong.

    I really appreciate you taking the time to help me with this. I think I just need to be shaken until the memories rattle loose. I think it has come back enough that I can get the animation to work, but if you have any suggestions on getting it into DW and showing on iOS systems, that would be wonderful.

    Thanks.

    Colin Holgate
    Inspiring
    August 17, 2018

    It sounds like you want the animation to work in mobile browsers, but that doesn't affect things too much.

    If each planet is a movieclip you only need to make the number of frames in the movieclip be enough to make them all work together.

    For HTML5 Canvas you would want to use Classic Tweens for performance reasons. After you have the keyframes needed to make one orbit, you would add extra frames to make the orbit last long enough.

    If you have a version already, and you can post it somewhere, we could look at the file and see what needs to be fixed.

    Colin Holgate
    Inspiring
    August 16, 2018

    There are many ways to go wrong, and I think yours is a different situation to the main topic here. I have an answer, or suggestion, but I think I will branch your post into a new topic first.

    Legend
    August 16, 2018

    ahurani  wrote

    I can't adjust the number of frames because then the fast planets disappear while the slow planets trudge their way around the sun.

    This is the problem you should be trying to solve instead of fiddling with frame rates. Why are the planets disappearing? If each planet animation is in its own movieclip, each movieclip should be looping, not disappearing.