Solved

Load the text and text colour from a text file

Posted on 2007-03-25
7
253 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

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.

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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.

617 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