all groups > flash actionscript > march 2006 >
You're in the

flash actionscript

group:

Simple script works on 8 not 7 -- WHY?


Simple script works on 8 not 7 -- WHY? # NO[at]SPAM # NO[at]SPAM #
3/2/2006 11:27:15 PM
flash actionscript:
I wrote the following script in Flash 8, draws line and text when published for
Flash Player 8:

B = _root.createEmptyMovieClip( "B_ mc" , 1 );
B.lineStyle( 5 , 0x000000 );
B.moveTo( 100 , 100 );
B.lineTo( 300 , 200 );
L = B.createTextField( "L_txt" , 2 , 500 , 200 , 100 , 100 );
L.text = "MY TEXT";


But when I publish it for Flash Player 7, the text isn't drawn.

PLEASE can anybody tell me WHY?

Thanks.
Re: Simple script works on 8 not 7 -- WHY? NSurveyor
3/3/2006 12:02:47 AM
In 7, createTextField does not return the newly created instance. Use:

B.createTextField( "L_txt" , 2 , 500 , 200 , 100 , 100 );
B.L_txt.text = "MY TEXT";

or

B.createTextField( "L_txt" , 2 , 500 , 200 , 100 , 100 );
L = B.L_txt;
L.text = "MY TEXT";
AddThis Social Bookmark Button