This content has been marked as final. Show 15 replies
create a transparent button in the authoring environment and put it on-stage and give it an instance name and attach your code to your button.
then use a function to size your button and to define the variables used in the mouse event.
you mean resizing a button with a transparent box inside instead of drawing the box ?
It could work, I'll try tomorrow.
no. just resize the button:
I tried that this afternoon as well, the button gets resized and the click zone is showing (at the correct size, stage size), but somehow the hit zone isn't updated, and I have no clue as to why :s
what do you mean by the "click zone" and the "hit zone"?
the "click zone" is, for me, the automatically created stage-size box with a fill, while the "hit zone" is the actual active zone of the button (changing cursor to hand and triggering the on (release) script).
if I manually create a fill in the movie clip embedded in the button, it counts as hit zone from the start, but if I have it created by a script, or resize the button, the hit zone isn't "updated", as if it were fixed at runtime and unmodifiable.
thanks for your help :)
that doesn't make sense: you have a (resized) true button and when you mouseover it you fail to see the mouse pointer change to indicate you're over a button?
sorry if I'm unclear.
my current architecture is :
- empty button (with one frame covering all states) [empty movieclip]
on the button is the on (release) code.
on the first frame in the movieclip is the draw box code.
when my swf loads, the button is empty, then, the movieclip is filled with a stage-size box, BUT the hitzone of the button containing it doesn't change.
you can't use an empty button. create a fill with alpha=0 for all frames.
that's what the code in the movieclip does : creating a fill the same size as the stage to serve as the button.
but anyway, I've come across a piece of adobe documentation stating that runtime creations don't accept on event handlers, so I guess what I try to make is impossible since I can't use anything else than a button and a button accepts only on event handlers, nothing else :(
you're wrong on both points. but if you're satisfied with those conclusions, good luck.
actually I'm very dissatisfied, but I don't have any idea on how I'm going to work around that issue ^^
I'm not someone content with something unfinished.
then follow the directions i gave for creating a transparent button.
resizing a button containing a transparent box worked perfectly.
I was trying to draw the box instead of starting with an existing one, that was a more complicated idea ^^