I have seen and read dozens of posts regarding this issue,
but do not see
any that answer my specific question about resizing a
textfield in flash.
I have a base MovieClip that will be used to make the buttons
navigation menu. I have a class that defined that movie clip
things like the label, size of the button and event handlers
The base MovieClip I used is pretty basic. It has two
MovieClips inside it
with instance names
Based on one of the parameters passed to the NavButton class
the button will
be resized (_x only). Likewise I would like the text field to
center in the
button. I have been able to accomplish the centering of the
bg_mc once the bg_mc MovieClip has been resized by using:
label_mc._x = (bg_mc._width - label_mc._width) / 2;
In the base MovieClip both bg_mc and label_mc have a width of
150, so if I
create a button with a width of 100 then the formula would
label_mc._x = (100 - 150) / 2;
which would be -25.
The problem is that the label_mc hanging off the ends will
trigger all of
the events of the button since it is part of the button. The
all 2 px apart so the extra part of label_mc will overlap the
button to its
left (since the buttons are placed on the stage from left to
increasing in the depth value)
SO, how do I resize the textbox within label_mc so that there
"blemmo" <email@example.com> wrote in
> Check out the hitArea property of the MovieClip class.
You could use the
> bg_mc as the hitArea of your buttons, so the overlapping
> trigger the events.
Thanks for the reply.
I thought about this solution and may have to use it. Is
there no way to
change the size of the textbox dynamically without text
I have even noticed before when sizing a textfield on the
stage, if the
handles are used after there is text in the field then it
works fine. But,
if I use the information API to specify the height and width
(H: and W:)
then the text will distort.