View Full Version : TextField Mask
MJWarren@Syr
07-18-2005, 04:53 PM
Does anyone know how to put a mask over a textfield? I can do a mask over a movieclip no problem but when i try to put it over a textfield, it wont work. I'm trying to scroll a bunch of texfields in a menu so i need some to disapear as they scroll out of the menu. any suggestions?
-tron
CyanBlue
07-18-2005, 05:27 PM
Howdy... :)
You need to embed the font for the textField you want to mask...
Ruben
07-18-2005, 06:21 PM
Wasn't it something like when you've got a normal dynamic field you need to embed in order to properly mask it. But when you're working with an html-enabled dynamic textfield you shouldn't embed it or something? I dunno...though I do know the whole embedding fonts thing in flash can be (and will be in most cases) a real pain.
...oh and if things don't seem to work out at all try using a runtime-applied mask (setMask (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary566.html)).
- Ruben
MJWarren@Syr
07-18-2005, 06:52 PM
yeah the fonts i am using are embedded and I have set the embed property to true. But can i actually use "setMask" on a textfield? it seems like it is a property in the movieClip class not in the textfield class. I am now trying to create my textfields as children of an empty movie clip but now the text wont even show up, heres a bit of my code.
private function textInitTwo(elm:String, k:Number,y:Boolean) {
if(!y) {
this["wordList"+k].removeTextField();
this["blue"+k].removeMovieClip();
}
else {
this.attachMovie("blue","blue"+k,getNextHighestDepth());
textDumby.createTextField("wordList"+k,getNextHighestDepth(), 0,0,0,0);
textDumby._x=_drop._x;
textDumby._y=_drop._y;
textDumby._height=myArray.length*12;
textDumby._width=_drop._width;
textDumby.setMask(masking);
this["blue"+k]._alpha=0;
this["wordList"+k].text=elm;
this["wordList"+k]._width=_drop._width-_mcScrollUp._width;
this["wordList"+k]._height=12;
this["wordList"+k]._x=_drop._x
this["wordList"+k]._y=_drop._y+4+(this["wordList"+k]._height*k);
this["blue"+k]._x=this["wordList"+k]._x-4;
this["blue"+k]._y=this["wordList"+k]._y+4;
this["blue"+k]._width=this["wordList"+k]._width;
myfmt = new TextFormat();
this["wordList"+k].setTextFormat(myfmt);
this.myfmt.font="Clearface Regular";
this.myfmt.size=12;
this.myfmt.color=0x000000;
this["wordList"+k].setTextFormat(myfmt);
this["wordList"+k].type = "dynamic";
this["wordList"+k].background = false;
this["wordList"+k].password = false;
this["wordList"+k].selectable = false;
this["wordList"+k].border = false;
this["wordList"+k].multiline = false;
this["wordList"+k].wordWrap = false;
this["wordList"+k].embedFonts = true;
this["wordList"+k].variable = null;
this["wordList"+k].maxChars = null;
this["blue"+k].onRollOver = function() {
_parent["blue"+k]._alpha=100;
}
this["blue"+k].onRollOut = function() {
_parent["blue"+k]._alpha=0;
}
//_int = setInterval(this._parent,"blueGuy",10);
}
}
MJWarren@Syr
07-18-2005, 06:55 PM
i also think i need to change all the "this["wordList"+k]" to "textDumby["wordList"+k]" but that isnt working either.
Ruben
07-18-2005, 07:07 PM
yeah the fonts i am using are embedded and I have set the embed property to true. But can i actually use "setMask" on a textfield?Play with it for a bit I'd say...
:) - Ruben
MJWarren@Syr
07-18-2005, 07:09 PM
yea i got it, playing with it for a bit is usually the best remedy. thanks
-ashy larry
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.