|
-
Prid - Outing
but I know what you mean as well, but sadly there is no built-in Event onResize event for Text Fields in AS2, BUT, there is however a way around this to make your own Event. This code is far more difficult, but since you really want an onResize event, this is the only way (in the example, I am supposing the textfield's instance name is, txt):
Actionscript Code:
TextObject = new Object(); AsBroadcaster.initialize(TextObject);
txt.autoSize = true;
txtSize = txt._width;
onEnterFrame = function(){ if(txt._width != txtSize){ txtSize = txt._width; TextObject.broadcastMessage("onResize"); } }
resizeListener = new Object(); resizeListener.onResize = function(){ trace("TextField has been resized!"); } TextObject.addListener(resizeListener);
Despite its complexity, the code is also bad and uses up memory because of the unnecessary onEnterFrame loop, which could've been replaced with onChanged event, but then we could just use the code provided in my previous post instead
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|