dcsimg
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
    118

    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,784
    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
    118
    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,784
    hi

    i suppose you will need to look into getRGB()

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

  5. #5
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,011
    why do you prefer swishmax over flash ide, what advantages do you see in it?


    Last edited by Alloy Bacon; 03-22-2019 at 01:44 AM.
    McYo || MangoWave

  6. #6
    Senior Member
    Join Date
    May 2016
    Posts
    118
    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