PDA

View Full Version : masking textarea


Durai_ram
02-11-2009, 10:38 AM
how to mask the particular text area using action script... plz any one provide the sample code or explanation for this ......

Durai_ram
02-13-2009, 05:09 AM
i got how to mask textarea, But i tried to addChild to canvas... i got only blank textarea can't saw the text... i need ur help guys!. i attached my code below ....


myText.setStyle("fontFamily","Verdana");
myText.setStyle("fontSize",12);
myText.setStyle("backgroundColor","undefined");
myText.setStyle("textAlign","center");
myText.width=150;
myText.height =40;
myText.wordWrap=true;

maskText.graphics.beginFill(0xFFFFFF, 0.5);
maskText.graphics.drawRect(0, 0,150,40);
maskText.graphics.endFill();
maskText.height=40;
maskText.width=150;
myText.mask=maskText;
oh.addChild(maskText);
oh.addChildAt(myText,0);

oh.x=150;
oh.y=280;
oh.mouseChildren=true;
oh.allowRotate=true;
oh.allowHMove=false;
oh.allowVMove=false;
oh.allowKeyboardManipulation=false;
oh.addEventListener(ObjectHandleEvent.OBJECT_RESIZ ING_EVENT,txtResize);
oh.addEventListener(ObjectHandleEvent.OBJECT_RESIZ ED_EVENT,resizeFont);
/// addEventListener(DragEvent.DRAG_EXIT,selectFontSty le);

myCan1.addChild(oh);