Has anyone come across a good way to duplicate movie clips but change there size in relationship to how much text is imported - like a message board some comments are long other short. I know it is commplicated but if anything would be great, I know people have done this kind of thing before. Thanks
just create an autoSize textfield in a movieclip. for example: _root.createEmtpyMovieClip("tboxMC",1); _root.tboxMC.createTextField("tbox",2,0,0,1,1); with(_root.tboxMC.tbox){ autoSize="left"; } now when you load your text and assign it to this textfield, tboxMC's (and tbox's) _height property will adjust.
This sounds great but doesn't autoSize make it expand width and higth, is there a text box attrabute to confine the width? also I am going to have to check for when the text is there, how should I check if it is loaded because the one on top has to be figured out before the box below, correct? thanks kglad, your the best.
no, autoSize doesn't affect the _width property. you can set width either in the createTextField() statement or later. i didn't do either in my code so that wouldn't work. you should use either: _root.createEmtpyMovieClip("tboxMC",1); _root.tboxMC.createTextField("tbox",2,0,0,yourWidth,1); // where yourWidth is defined on this timeline with(_root.tboxMC.tbox){ autoSize="left"; } or: _root.createEmtpyMovieClip("tboxMC",1); _root.tboxMC.createTextField("tbox",2,0,0,1,1); with(_root.tboxMC.tbox){ _width=yourWidth; // again, define this parameter. autoSize="left"; }
and you should use a data handler to figure out when data has been received. for example: _root.creatEmptyMovieClip("dataHolder",3); dataHolder.loadVariables("yourText.txt"); dataHolder.onData=function(){ _root.createEmtpyMovieClip("tboxMC",1); _root.tboxMC.createTextField("tbox",2,0,0,1,1); with(_root.tboxMC.tbox){ text=this.yourTextVar; // where yourTextVar is defined in yourText.txt _width=yourWidth; // again, define this parameter. autoSize="left"; } }
Don't see what you're looking for? Try a search.
|