[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Two different colors and fonts in the same textarea

Posted on 2007-10-11
6
Medium Priority
?
1,016 Views
Last Modified: 2012-05-05
Hi,

Im trying to print out an dynamic text that I have combined from two var.
Example:

var text1 = "text number 1";
var text2 = "text number 2";

var combined = text1 + text2;

t.icon.testText.text = combined;

Now I want to set text1 to have one font size and color and text2 another.

Is it possible to do something like var combined = text1 + "<span style='color:#cccccc'> " + text2 +"</span>";
I don't thinks

The whole thing is going into a textarea that I don't at the moment put in by code. But i would like that but when I tried it did not work and the text was distorted when I was animating it.

0
Comment
Question by:stalbergpar
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:Bradley Haynes
ID: 20059045
All the direction you may need to modify text in Macromedia:
http://www.adobe.com/devnet/dreamweaver/articles/css_forms.html
0
 

Author Comment

by:stalbergpar
ID: 20059088
Hmm Sorry But this is a Adobe Flash problem...
0
 
LVL 16

Expert Comment

by:Kiran Paul VJ
ID: 20059878
try this

on you textarea properties panel, select parameters, select html as true

now try something like this

text1.text = "<font color='#FF0000'>This is red text</font><font color='#0000FF'> This is blue text</font>";

where text1 is the instanse name of your textarea,. I have check it in Flash 8, dont know the case of CS3

kiranvj
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 16

Accepted Solution

by:
Kiran Paul VJ earned 750 total points
ID: 20059909
or just try this

var text1 = "text number 1";
var text2 = "text number 2";

var combined = "<font color='#FF0000'>"+text1 +"</font><font color='#0000FF'>"+ text2 +"</font>";

t.icon.testText.html = true;
t.icon.testText.text = combined;
0
 

Author Comment

by:stalbergpar
ID: 20061671
Yep the last one did not work but I found the problem.
need to set the test output to the var to htmlText insted of just .text
Solution here:

var text1 = "text number 1";
var text2 = "text number 2";

var combined = "<font color='#FF0000'>"+text1 +"</font><font color='#0000FF'>"+ text2 +"</font>";

t.icon.testText.html = true;
t.icon.testText.htmlText = combined;
0
 
LVL 16

Expert Comment

by:Kiran Paul VJ
ID: 20063080
t.icon.testText.text worked fine for me in Flash 8

but first I checked with htmlText (which i saw in website). but somehow it did not work in Flash 8, I dont have cs3 on my machine, so i could not check. Anyway glad to know its fixed :)

kiranvj
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to how to record live broadcast.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

834 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