A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [CS3] How to end this Rain animation?

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    1

    Unhappy [CS3] How to end this Rain animation?

    Hi, this might seem like kind of a dumb or simple question, but it's been agonizing me for a while. On my site, I employed the rain animation code found here:

    http://www.flashkit.com/movies/Effec...1418/index.php

    It's more or less exactly the same code with very little things changed.


    I have the rain animation playing through one of my scenes, but when you go to another scene, the rain persists! It looks terribly out of place.

    So, I suppose my question is,

    how do I get the rain to stop? (and to continue when you return to the appropriate page) I've tried a variety of things, but I'm a relative bonehead when it comes to scripting...

  2. #2
    Hi,

    your question isn`t dumb. This is ActionScript, not pizza

    Because of the dynamically generating of rain drops - you have to remove them also dynamically. Thic can be done by script like this:

    Actionscript Code:
    for (m=0; m<=60; m++) {
       
        removeMovieClip(_root["drop"+m]);
       
    }

    You can put this script at frame where your new scene starts.

    Note: m<=60 - this is the amount of raindrops, which is generated with the AS in frame 1.

    Note: _root["drop"+m] - this is correct sintax for geting dynamically generated object. The instance name is same as instance name used in frame 1. And the varaible "m" is for the number of this dynamic instance.



    Scotty does know how to Fla-make cool ads.

    http://flamake.net - this Ads will Fla-make you crazy. Find your cheap flash banners and see the best commercials around the world.

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