Ok, maybe it’s my fault. I usually push for feature requests once I feel I’ve reached the comfort plateu with the current version of Flash. However, I severely dropped the ball on this one, so I urge you now to please help me rectify the situation.
Please, add a request to the <a href=”http://www.macromedia.com/support/email/wishform/?6213=9″>Flash wish-list</a> for Macromedia to implement a return value for createTextField, that value being the text field just created; similiar to attachMovie/createEmptyMovieClip/mc.duplicateMovieClip.
This is frikin’ ridiculous, and I don’t know how it slipped past in this version of Flash as there, I thought, were many of us befuddled by it in 6. Maybe that was it… a minor annoyance, but not as profound as right click. At any rate, let’s not wait for Flash 9 before this is rectified, please!
<a href=”http://www.macromedia.com/support/email/wishform/?6213=9″>Wish</a>!
i’m on it man! This bugs the crap out of me too!
Very true Jesse! Its kinda ridiculous having to code your own routine to check if its there or not.
I agree that this is something Macromedia should fix but in the meantime here’s some code that might help you get by:
MovieClip.prototype.oldCreateTextField = MovieClip.prototype.createTextField;
MovieClip.prototype.createTextField = function(name, depth, x, y, width, height){
this.oldCreateTextField(name, depth, x, y, width, height);
return this[name];
}
var myTF = createTextField(“Cow”, 10, 50, 50, 100, 20);
myTF.text = “moo”;
Prototype fi, never die.
That’s a prototype I don’t mind using… thank you!