A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: How to color an object with the same color as another object ( AS2 )

  1. #1
    Senior Member
    Join Date
    May 2016
    Posts
    451

    How to color an object with the same color as another object ( AS2 )

    Hi all,

    swishmax - ActionSript 2

    When i press button
    How to set MC2 color with the same MC1 color



    thanks
    Attached Files Attached Files

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    hI,

    I don't know if AS2 works with swishmax or not, but you can mess with this
    PHP Code:
    var colour1:Number 0xFF0000;
    var 
    colour2:Number 0x0066CC;

    var 
    movieClip_1:Color = new Color(MC1);
    var 
    movieClip_2:Color = new Color(MC2);

    MC1.onRollOver = function()
    {
        
    movieClip_1.setRGB(colour2);
    };

    MC1.onRollOut = function()
    {
        
    movieClip_1.setRGB(colour1);
    };

    MC2.onRollOver = function()
    {
        
    movieClip_2.setRGB(colour1);
    };

    MC2.onRollOut = function()
    {
        
    movieClip_2.setRGB(colour2);
    }; 

  3. #3
    Senior Member
    Join Date
    May 2016
    Posts
    451
    thanks fruitbeard ,
    yes AS2 works with swishmax
    your Code is working in my swishmax But you put a specific color
    what do I do if the color changes automatically
    Thank you so much

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    hi

    i suppose you will need to look into getRGB()

    https://www.oreilly.com/library/view...8520/re23.html

  5. #5
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    why do you prefer swishmax over flash ide, what advantages do you see in it?


    Last edited by AS3.0; 03-22-2019 at 01:44 AM.

  6. #6
    Senior Member
    Join Date
    May 2016
    Posts
    451
    swishmax is my old friend
    it is easy and simple
    thank you Alloy Bacon

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