Flash MX - Button Properties
- Started
- Last post
- 4 Responses
- autonoma
Supposedly you can change the properties of a button with actionsscript in Flash MX, but it's not working for me. I'm simply trying to set it's width using:
photoButton._width = imageContainer._width;
but it's not working. Why? Not even this works:
photoButton._width = 150;
What's up?
- unformatted0
did you give the button an instance? i think the syntax is
button.width not button._width
- autonoma0
Yes, I gave it a name. This is directly from the Flash help file:
Example
The following code example sets the height and width of a button when the user clicks the mouse:
myButton._width = 200;
myButton._height = 200;
- londonBoy0
original: photoButton._width = imageContainer._width;
try: photoButton._width = getProperty(imageContainer, _width);
- autonoma0
No need for getProperty with dot syntax.
I figured out the problem. It was a transparent button with nothing in the first frame, so there was nothing for Flash to measure.