A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Comet orbits a planet -- how?

  1. #1
    SASH
    Join Date
    Feb 2001
    Location
    Oman
    Posts
    6
    Hi there,
    hope you don't mind a new Flash fan...

    I'm working on a Flash movie that includes a comet orbiting a planet.

    1) To create the comet, I'm thinking of using a series of circles (balls?) that follow the curved orbit, while transforming Alpha (fading into background) and transorming scale (from larger to smaller). Is this the right way to generate the comet or do you have better ideas?

    2) Following my aproach, I found the TrailerBall sample in Flash 4 very useful. Although jumping directly to scripting wasn't easy, but managed to create desired fading effect of ball series on the curved path.

    3) The problem now is forcing the balls to reduce scale as they move, while mentaining the fading. I tried to control _xscale and _yscale properties using same values (constraining), but scaled balls don't reserve their original location, and consequently, don't follow the path.

    4) The other alternative is to use a layer+a motion guide for each ball and alter each ball properties. But I think this would be a long and irretating process, and wouldn't load fast I assume...

    Any suggestions, comments or even chuncks of codes would be of great value...

    Many thanks,

    Saed

  2. #2
    can anyone sew my main?
    Join Date
    Aug 2000
    Posts
    182

    Arrow Tutes

    There is a cool tutorial in the tutorials section here at flashkit that should help you. Its called pseudo orbiting ball or something- cehck it out, it may help.

  3. #3
    SASH
    Join Date
    Feb 2001
    Location
    Oman
    Posts
    6
    Thanks for the advice pal. I checked the tutorial but wasn't of great help. I have no problem in creating the path or making the object orbits around the planet. The problem is in creating a comet by using balls and make all move as realistically as possible. Guess I need to be more specific.

    To start with, there is the 'master' ball that forms the comet body. Moving this ball following an ecliptic orbit is done.

    Next comes the trailing tail of the comet that needs to look like an extended cone. As the comet body moves, the tail needs obviously to follow. To create the tail, I used a bit complicated script to create 10 balls by duplicating a movie clip that animates a single ball's motion. The code also sets a short time delay to synchronise the 10 balls motion. So, when the master ball starts moving on the orbit (motion guide), the second follows after short delay, then the third and so on. Due to the short delay, the balls partially overlap, and hence appear as a continuous linked chain of balls that twists following the orbit curving.

    Further more, the script also reduces the transparency of each generated tail ball by 10% via controlling Alpha property, so tail ball #1 has 90% transparency while the last ends with 10%. As the balls travel over the orbit, the tail's cone fades into background while keep on changing position. All this has been achieved.

    Now comes the challenging part. Till now, tail balls have same size which they maintain as they move. What I want is to reduce the size of each generated ball of the tail say by 10%, without affecting the ball's original position in order to create desired effect of the comet's trailing conical tail, I set both _xscale and _yscale to same value (constrain) that reduce in magnitude for each generated ball (starting by 90% and ending with 10%). As a result, the cone was successfully created, but once the master ball begins to move, tail balls don't start their motion from same master ball position, nore they travel following the path. Prior to this step, things went OK. I tried setting the scene's centre as the master ball's, but didn't work. After comprehensive code altering and testing, I decided to seek after assistance... Any suggestions? Is this the right forum for such or should I try somewhere else?

    Cheers,
    Saed

  4. #4
    can anyone sew my main?
    Join Date
    Aug 2000
    Posts
    182

    AHHHHHHH

    Well sounds sho nuff like a dilemma, and everything you have aleady tried sounds like good ideas to me-LOL, Sorry I cant help more. Try posting this in an actionscript forum and see if there is anyone who has run across this before.

    Good luck with your balls

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