A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: problems changing colour of a movieclip on a button press

  1. #1
    Join Date
    Sep 2005

    problems changing colour of a movieclip on a button press

    hi, im coding a api drawing program in flash8 and im trying to create a colour preview box.

    i was attempting to write code to change the hexidecimal colour value of a movieclip (which is a white square with the instance name of colour_mc) when a button is pressed.

    The code for the buttons which when pressed will change the colour of the white square look like this:

    //colour is a varible for hexidecimal colour of the linestyle command
    //colour_mc is the white square which is ment to change colour.

    a_btn.onRealease = function() {
    colour = 0x000000;
    colour_mc.transform.colorTransform = 0x000000;

    I thought this code would work but it doesnt the movieclip doesnt change colour at all. Does anyone know were im going wrong? thanks

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Rio de Janeiro, Brazil
    Try this:

    a_btn.onRelease = function()
    mycolour = new Color(mymc);
    mycolour.setRGB (0x000000);

  3. #3
    Join Date
    Sep 2005
    lovely stuff thank you!
    i need to learn the commands keep using the wrong ones.

  4. #4
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    The letters on my F1 key have faded, because i can't remember all that stuff, seldomly used

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