3 Replies Latest reply on Jan 21, 2007 8:16 PM by ggshow

    How to create a blinking starfield with one mc

      I have create one blinking star in a mc.
      It´s moving in a circle and blinking and changing colors.

      Now I want to create a starfield with blinking stars where every individual
      star is moving in a different way.

      The problem is, if I copy and past 100 of this mc with my blinking star in the
      same timeline (main) Theres no individuality. (I hope you understand my swedish/english).

      I know that I can copy an paste the same mc at 100 different frames..but that´s "low tech.

      Now then:
      How the should the actionscript looks like which manage to solve this problem?
      random something...??

      I know I can read and learn, but I ´ve been working with this site for over a year now and I have
      become halfblind (not really - I use glasses) of reading actionsript all nights long and working
      at my regular job from 9 to 5.
      The technical stuff It´s in other words not my strenght :wink

      Here´s my portfolio site: http://www.goodwill.se
      (The actionscripting is done with a lot of help from this forum)

        • 1. Re: How to create a blinking starfield with one mc
          shikozel Level 1
          you need to give your star movie clip a linkage name. lets say star_mc. Then loop 100 times. in each loop you attach the star_mc in a random place on the stage. lets say the width of your stage is 500wx500h. The code should look like that:

          for(var i:Number=0;i<100;i++){
          star_mc=_root.attachMovie("star_mc","star_mc"+i,_rott.getNextHiestDepth())
          star_mc._x=random(500)
          star_mc._y=random(500)
          }

          maybe I have some typo but this is the idea
          • 2. Re: How to create a blinking starfield with one mc
            Creating a blinking starfield from one blinking mc.

            >you need to give your star movie clip a linkage name. lets say star_mc. Then loop 100 times. in each loop you attach the >star_mc in a random place on the stage. lets say the width of your stage is 500wx500h. The code should look like that:

            >for(var i:Number=0;i<100;i++){
            >star_mc=_root.attachMovie("star_mc","star_mc"+i,_rott.getNextHiestDepth())
            >star_mc._x=random(500)
            >star_mc._y=random(500)
            >}

            Cool, this is the first step- to spread the mc all over.
            But I wonder if they can be spread in time.
            So every star move individual in time.
            Now they move and blinking as a group, where every
            star is in the exactly same position in their tweening
            process, in time.
            (the blinking status is exactly the same for eveyone)