Solved

Load the text and text colour from a text file

Posted on 2007-03-25
7
241 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 500 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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Firefox video player - embedded native versus VLC player 3 1,105
Flash doesn't load in Iphone and Ipad 22 497
black magic design 1 131
PDF edit software 2 35
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

756 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