PDA

View Full Version : TextField Conversion 8 to 7



Jpao17
June 30th, 2006, 12:43 PM
Ok so I created a project using AS2 classes in Flash 8 and everything worked just dandy. But since theres no Director 8, only Director MX, i had to convert my Flash 8 project to a Flash 7. NP Right? Well Everything still works just great, the only problem is 1 single line of code:

LinkText = LinkBox.createTextField("Text", this.getNextHighestDepth(), 0, 0, null, null);

(LinkBox is a MovieClip)
Anyway, if i were to: trace(LinkText); right after that line, in Flash 8 it spits out _level0.linkbla.blabla.blabla.bla.lba, the path to the Textfield. but in Flash 7 it spits out "undefined"

I know there was a major change between the way Flash 8 handles text than Flash MX but im stumped, perhaps you guys can help with with this one?

Thanks! -Chris

Jpao17
June 30th, 2006, 02:12 PM
Alright I found the problem, In Flash 7 and lower, the function 'createTextField' had a return of :Void

so Saying LinkText = LinkBox.createtextfield(blabla) was the same thing as saying:
LinkText = null;

Flash 8 fixed it by giving createTextField a return of :TextField, so its

LinkText = TextField

The Fix is to first Create the textfield under LinkBox, and then set it to LinkText, as follows:

LinkBox.createTextField("Textt", this.getNextHighestDepth(), 0, 0, null, null);
LinkText = LinkBox.Textt;

Hope this helps someone else out there

-Chris