Solved

Flex 3 Rich Text Editor TextArea and modifying the "leading" value

Posted on 2009-07-08
4
1,881 Views
Last Modified: 2012-06-27

Is it possible to add a drop down to the RichTextEditor Toolbar that allows you to manipulate the "leading" value (line spacing)?

I tried rte2.textArea.setStyle("leading", 0), but it seems to get overridden with what comes across in the original HTMLTEXT string.

The best site I found was http://blog.flexexamples.com/2008/05/31/setting-the-leading-on-a-text-control-in-flex/, but I was unable to use the methods to manipulate this value in the RichTextEditor.

Thanks for any help you can offer!
0
Comment
Question by:20lbMonkey
  • 3
4 Comments
 
LVL 7

Expert Comment

by:nikhilmenon
ID: 24811283
I don't think you could actually go about and do that with the Control as it is. You could consider making your own component from scratch or modifying the RTE control to suit your needs. Or add a little slider (as the example suggests) next to your Rich text editor to perform the same function.
0
 
LVL 7

Expert Comment

by:nikhilmenon
ID: 24811330
Also, I tried it out with a simple RTE and two buttons which changed the leading values of the RTE to one and 10 calling the functions as shown in the code snippet. Worked just fine.
private function setToTen():void{

	rte.setStyle("leading","10");

}
 

private function setToOne():void{

	rte.setStyle("leading","1");

}

Open in new window

0
 
LVL 7

Accepted Solution

by:
nikhilmenon earned 500 total points
ID: 24811340
And I just noticed you have to put 0 in the function call enclosed within quotes. You haven't done that. Your code should be

rte2.textArea.setStyle("leading", "0")

Apologies for the multiple posts.
0
 

Author Closing Comment

by:20lbMonkey
ID: 31601447
Thank you for your mulitple posts! Its funny how you can look at something for so long and totally ignore the obvious.

Thanks again!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now