10 Replies Latest reply on Jun 20, 2007 1:50 PM by kglad

    Please Please help!!!!

    jude86
      At the moment i am trying to change the colour of a movie clip, so far my code reads:

      var hexColor:Colour - new Color(one_mc);
      hexColor.setRGB(0xFFFFFF);

      This is working however, on my movie clip i have a black border around the edge and i want this to stay black, is there any way i can change only the colour fill of the movie clip and let the border remain the same??????

      Another problem i am having with my code, i want for example my movie clip to change to three different colours automatically as the swf opens, however i want this to be a slow change not so blindingly fast that you miss it. I tried using a series of if statements but this was to quick so i changed to using the setInterval function, as i am still stuck using as2!!!!!

      This is working and giving me the results i wanted, however i have about 20 movie clips that i want all to do the same thing starting off at different times, so this is going to mean a lot of coding, i was just wondering if anyone out there knew of a better more effcient way of doing this, i thought perhaps a loop would be able to do this for me but i've hit a mental block!!!! Im not being cheeky and asking for a whole solution, i just need a point in the right direction, so for example, if someone says a switch statement will work in this case, i can go away and try and crack it myself, but at the moment ive just ran out of ideas :(

      Many thanks for all your help!!!!

      Cheers Jude x
        • 1. Re: Please Please help!!!!
          whodeee
          For your first problem, the fill issue, the way around it fill and the border is to create the border as a separate movieclip, and only change the color of the fill movieclip. Let me see if I have figured out a way for your second issue, I was trying to do a simialar thing recently.
          • 2. Re: Please Please help!!!!
            MaxManNH Level 2
            I am not too sure about keeping the lines from changing color. However if you are looking for a simple way to tween the colors of a movie clip via actionscript go to www.mosessupposes.com and download the Fuse Kit by Moses Gunsech. It is one of the best things out there for running actionscript tweens. Plus there are shortcut commands that allow you to make simple statements to change colors of movieclips and to string together multiple tweens in order using the Fuse API.

            As far as keeping the border form changing. I would cheat and slap another movie clip on top with just the black border.
            • 3. Re: Please Please help!!!!
              Pop_Clingwrap Level 1
              Make the border and the fill two seperate clips (fillClip & outlineClip) nested within one_mc then change your code to this:

              var hexColor:Colour = new Color(one_mc.fillClip);
              hexColor.setRGB(0xFFFFFF);

              For your second query I would suggest something like this (although without knowing exactly what you are doing I might be well off):

              Set up an Array whith all you 20 clips stored in it then make a function that uses setInterval to change the color of any clip that is sent as an argument to that function (should be similar to the script you are already using).
              Lastly, make another setInterval that steps through the array and sends each clip to the function as it reaches it.

              Be carefull to give each setInterval an individual name (maybe stored in an array) or you will get in to all kinds of looping issues

              Bit vague im afraid but I hope it helps
              • 4. Re: Please Please help!!!!
                jude86 Level 1
                Hey thanks for all your answers they are great i will go away and have a fiddle about with my code after all the adivce you guys have given me!!!! :D

                Thank you, you have all definetly saved my day :D

                cheers again

                Jude x
                • 5. Re: Please Please help!!!!
                  jude86 Level 1
                  Okay, so i persevered with the arrays and functions and i used some code off the forum to help me get this code working and my movie is now changing colour how i want it to now :D However i have a slight problem i cant seem to get it to stop randomly changing colours??!?!?! Any advice?? The code is attached below:
                  • 6. Re: Please Please help!!!!
                    jude86 Level 1
                    Oh i might not have made this point very clear........i want the _mc's to change colour for a certain time and then stop, not just stop after the one colour change.

                    Thanks for any help :D

                    Jude x
                    • 7. Re: Please Please help!!!!
                      jude86 Level 1
                      hello,

                      Sorry guys, to be a complete pain, just wondering if anyone knows of a solution to my problem, i was chuffed when i got it all working but i just cant work out how to stop it :S?!?!?!?!

                      Please help, i would be very grateful :D

                      Many thanks
                      • 8. Re: Please Please help!!!!
                        kglad Adobe Community Professional & MVP
                        instead of:

                        • 9. Re: Please Please help!!!!
                          jude86 Level 1
                          Brilliant,

                          Thank you so much thats great :D
                          • 10. Re: Please Please help!!!!
                            kglad Adobe Community Professional & MVP
                            you're welcome.