Groups | Blog | Home
all groups > flash actionscript > march 2005 >

flash actionscript : Strikethrough text


EvilJordan
3/16/2005 10:03:36 PM
Is it built in, or is it possible to have strikethrough text (like the <s>
tag in HTML> in Flash?


begin 666 EvilJordan.vcf
M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..CM%=FEL2F]R9&%N.SM-<@T*
M1DXZ179I;$IO<F1A;@T*6"U704(M1T5.1$52.C(-"E523#M(3TU%.FAT=' Z
M+R]W=W<N979I;&IO<F1A;BYC;VT-"E523#M73U)+.FAT=' Z+R]W=W<N979I
M;&IO<F1A;BYC;VT-"D5-04E,.U!2148[24Y415).150Z179I;$IO<F1A;D!A
I;VPN8V]M#0I2158Z,C P-3 S,3=4,#,P,S,V6@T*14Y$.E9#05)$#0H`
`
end
EvilJordan
3/17/2005 1:40:49 AM
After much cursing at Macromedia for not including something as simple as a
Strikethrough option for text, I wrote this. It's quick, it's easy, and it
works. Flash MX 2004 supports CSS my ass.


tfNewfield.text = "This is a test to see if dynamic text can have a strike
through it!";
tfNewfield.autoSize = true;

var newclip = this.createEmptyMovieClip("someshapes", 2);
var bounds_obj:Object = tfNewfield.getBounds(this);

with (newclip) {
lineStyle(1, 0xFF0000, 100);
//diagnol strike
moveTo(tfNewfield._x, tfNewfield._y + tfNewfield._height);
lineTo(tfNewfield._x + tfNewfield._width, tfNewfield._y);
//straight strike
midh = ((tfNewfield._y + tfNewfield._height) / 2) + (tfNewfield._y / 2);
lineStyle(1, 0xFF0000, 100);
moveTo(tfNewfield._x, midh);
lineTo(tfNewfield._x + tfNewfield._width, midh);
}

AddThis Social Bookmark Button