Solved

Load the text and text colour from a text file

Posted on 2007-03-25
7
208 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
  • 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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…
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 what frame rate is, how to control it and what effect it has on the video.

758 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

23 Experts available now in Live!

Get 1:1 Help Now