Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Load the text and text colour from a text file

Posted on 2007-03-25
7
Medium Priority
?
260 Views
Last Modified: 2010-04-03
Hi,

You have solved a problem we were having earlier on ID: 22470495 (Control Flash stage background colour using External Text File) and we now have another one.

How to load the text and text colour from a text file, different line of text with different colour control in one text file.

Many thanks
0
Comment
Question by:t_rice
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 37

Expert Comment

by:CyanBlue
ID: 18788278
Create a new FLA file... and save it as htmlTextTest.fla...
Create a textField on the stage and make it multiline, html enabled and give it an instance name of content_txt...
Create a new layer and select the frame 1 of it and add this script...

var txt_lv:LoadVars = new LoadVars();
txt_lv.onLoad = function (ok)
{
      if (ok)
      {
            content_txt.htmlText = this.textContent;
      }
      else
      {
            trace("Error loading text file...");
      }
}
txt_lv.load("content.txt");

Save the file...
Open up the notepad and paste this and save it as content.txt file in the same directory...

textContent=<font size='24' color='#0000FF'>This is blue, 24 point text.</font> <font size='36' color='#FF0000'>This is red, 36 point text.</font> <font size='16' color='#00FF00'>This is green, 16 point text.</font>

Go back to Flash and test the FLA file to see if it is working...  :)

CyanBlue
0
 

Author Comment

by:t_rice
ID: 18788635
Hi,
Thanks for getting back.  Below is what we've tried and it's not working completely.  Its only text apple <font that appears, no colour.  We also, need need control of the alpha of the text.

/ ******* Background ******** //

// Background01
&BGcolor1=0xFF6600&

// Background02
&BGcolor2=0x000000&



// ******* Title Color ******** //

&Tcolor1=0xFFFFFF&



// ******* Title ******** //

// Tittle 1-1
&tittle11=MINALE&
&tittle11a=TATTERFIELD&










// ******* Settings ******** //

&textlabels=yes&

// ******* Background ******** //

// Background01
&BGcolor1=0xFF6600&

// Background02
&BGcolor2=0x000000&



// ******* Title Color ******** //

&Tcolor1=0xFFFFFF&



// ******* Title ******** //

// Tittle 1-1
&tittle11=name&
&tittle11a=name&










// ******* Settings ******** //

&textlabels=yes&


Thanks
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 18788962
Well...  I don't really understand what you said...  Did you try what I have provide and see if it worked for you or not???

FYI, you cannot set the text alpha value unless you embed the font for it...

CyanBlue
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:t_rice
ID: 18789033
Hi, sorry for not being clear.

Yes, we tried to use what you gave us but it only appears <font. also can we set the text as a moive clip and make it alpha 40 %?

Thanks again :)
0
 
LVL 37

Accepted Solution

by:
CyanBlue earned 2000 total points
ID: 18789100
I don't think youv'e done all I have asked in the first post...
Do me a favor and do what I exactly said and post it up somewhere so that I can fetch it to see what you are doing wrong...

Yes, you sure can put the textField into a movieClip and set the _alpha value of it, but you still need to embed the font...

CyanBlue
0
 

Author Comment

by:t_rice
ID: 18789517
Thanks, we tried it again and it worked, sorry about that. :)
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 18789910
Not a problem...  Glad to hear that you've got it working...  :)

CyanBlue
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

670 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