-1

I am currently following an online programming class at my school. We are studying Flash and therefore actionscript 3 and I am having difficulty in one of my projects.

I want to easily be able to change the border color of my button when the user clicks on it but I can't seem to find how. Until now, I used to change the entire button's color, but I want to try a new effect. To change the entire color I used this code :

var ctAvance:ColorTransform = btnAvance.transform.colorTransform;
ctAvance.color = 0x00CCCC;
btnAvance.transform.colorTransform=ctAvance;

Thanks a lot in advance!

  • 1
    Possible duplicate of [Changing fill color of MovieClip Actionscript 3](http://stackoverflow.com/questions/796671/changing-fill-color-of-movieclip-actionscript-3) – Brian Nov 09 '16 at 22:49
  • @Brian This question is not duplicate of the question you mentioned. It asked us to change color of stroke, not the fill. However, the approved answer provided in the question you mentioned can be helpful. – Kiran Shakya Nov 12 '16 at 06:42
  • @KiranShakya That's a good note to [edit] in to the question, to highlight the differences between the two questions. Still, I'd argue that this question *is* a duplicate if reading the other one gives you the answer to this. – Brian Nov 14 '16 at 18:55

1 Answers1

-2

its a possible duplicate of this question


its impossible in that way (using ColorTransform) however:

  • you have another option, if your btnAvance is a Movieclip or something else, convert*1 it to a Button instead, then inside your object, you have 4 frames in the names of Up Over Down Hit, under Over frame press F6 (insert keyframe) and simply change your button border color

Edit:

*1 : you must convert it in library, not only your instance in stage, find your btnAvance in library list, rightclick on it then select properties and change its type.

Community
  • 1
  • 1
payam_sbr
  • 1,428
  • 1
  • 15
  • 24
  • Thank you for your help, but this isn't exactly what I am looking for.. I want the button to change permanently. – Alexis Raymond Nov 10 '16 at 18:39
  • This question is not duplicate of the question you mentioned. It asked us to change color of stroke, not the fill. However, the approved answer provided in the question you mentioned can be helpful. – Kiran Shakya Nov 12 '16 at 06:40
  • @KiranShakya why dont you check that question? Just check that question body and open you eyes and find out its a duplicate – payam_sbr Nov 12 '16 at 10:33
  • Yes you are right that these questions are similar, but I have not seen anywhere in the question body asking for changing stroke color. Stroke and Fill are totally different, aren't they? – Kiran Shakya Nov 13 '16 at 01:15
  • @KiranShakya, forgive me if i said question body, please check out accepted answer instead, which explain's exactly stroke and fill, http://stackoverflow.com/a/796731/5862335 – payam_sbr Nov 13 '16 at 01:31