Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 859 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Flash and Actionscript :

HTML Text box Masking

Thread title: HTML Text box Masking
Closed Thread    
    Thread tools Search this thread Display Modes  
07-20-2008, 07:13 PM
#1
Petertang is offline Petertang
Petertang's Avatar
Status: Junior Member
Join date: Sep 2007
Location: Singapore
Expertise:
Software:
 
Posts: 51
iTrader: 0 / 0%
 

Petertang is on a distinguished road

Send a message via Yahoo to Petertang

  Old  HTML Text box Masking

Is anyone know how to apply the masking to the HTML Dynamic Text box?

07-20-2008, 07:47 PM
#2
Tom W is offline Tom W
Tom W's Avatar
Status: I'm new around here
Join date: Feb 2008
Location:
Expertise:
Software:
 
Posts: 24
iTrader: 0 / 0%
 

Tom W is on a distinguished road

  Old

Try doing it with ActionScript using setMask().

07-21-2008, 06:36 PM
#3
Petertang is offline Petertang
Petertang's Avatar
Status: Junior Member
Join date: Sep 2007
Location: Singapore
Expertise:
Software:
 
Posts: 51
iTrader: 0 / 0%
 

Petertang is on a distinguished road

Send a message via Yahoo to Petertang

  Old

Originally Posted by Tom W View Post
Try doing it with ActionScript using setMask().
I have tried, but it does not work for html text format.

07-23-2008, 05:31 AM
#4
Petertang is offline Petertang
Petertang's Avatar
Status: Junior Member
Join date: Sep 2007
Location: Singapore
Expertise:
Software:
 
Posts: 51
iTrader: 0 / 0%
 

Petertang is on a distinguished road

Send a message via Yahoo to Petertang

  Old

I reliased that to apply masking to a dynamic text field, it needed to embed the font to the flash. But some of the html tag could not work for the html text field such as <br>,<b> and <strong>. I tried using the \n to replace the <br> tag in order to move the text to the next line and it work on \n. i also tried to using the stylesheet.

Do anyone know what the mistake i made? Below is the script and the style sheet i wrote:

ActionScripting:
-----------------------------------------------------------------
var styleObj:TextField.StyleSheet = new TextField.StyleSheet();

var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "WalkwayBlack";

var my_fmt1:TextFormat = new TextFormat();
my_fmt1.font = "Whimzee";

txt.embedFonts = true;
txt.autoSize = true;
txt.html = true;
txt.styleSheet = styleObj;
txt.htmlText = "<u>testing</u> <br><span class='headline'>testing</span>\ntesting";
txt.setTextFormat(my_fmt);

txt1.embedFonts = true;
txt1.html = true;
txt1.htmlText = '<u>testing</u> <b>testing</b> testing';
txt1.setTextFormat(my_fmt1);

styleObj.load("styletest.css");

maskobj_mc.setMask(txt);
----------------------------------------------------------------

CSS Style Sheet: styletest.css
-----------------------------------------------------------------
.bold {
font-weight: bold;
}
.headline {
color: #333333;
font-size:26px;
font-weight:bold;

}
-------------------------------------------------------------------

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed