action script help Please!

  • Started
  • Last post
  • 3 Responses
  • effour

    So i'm making a catalog where you click a color button and it changes the rgb values of the movie clip "shirt" like so:
    pocketObj = new Object();
    pocketObj.ra = 100;
    pocketObj.ga = 100;
    pocketObj.ba = 100;
    pocketObj.rb = 0;
    pocketObj.gb = 0;
    pocketObj.bb = 0;
    myColor = new color("pocket");
    myColor.setTransform(pocketObj);

    All I want is to make another movie always equal to the "shirt" values.

    Is it possible?
    Thanks,
    effour

  • unfittoprint0
  • effour0

    I figured out all of that stuff and it works good.

    The thing I want to do is have another clip that is always equal to the values of the "shirt" clip. So when the rgb values are changed on the "shirt" clip they are automatically changed on the "othershirt" clip

    that make sense?

    thanks.

  • unknown0

    effour,

    the cleanest method to do this is by using custom classes. Most Flash developers put aside classes and their methods just because they look freightening. It isn't so. This is one way how you might solve that. You create a class called TShirt with preset number of attributes (child properties), in this case color settings. You create TShirt objects and place them on your scene through AS and assign initial master color values. The point behind this is that all objects created using TShirt class will inherit all properties of the main class, which means that if you change the properties in the main definition, that will affect all TShirt objects in your movie. If you wonder where to find out more about classes, methods, superclasses etc. I would recommend the book from Macromedia "Advanced Actionscript" Training from the Source. You can browse through the MM site and look for classes, they usually have all of those examples and stuff online.

    Hope this helps. I would really like to help you with the code, but I'm slammed with other shit. What's your deadline? Maybe I grab some time tomorrow.