Solved

When using a .txt file to update text within a movie - Can you do specific things with that text?

Posted on 2001-06-22
3
188 Views
Last Modified: 2010-04-03
Topic says all really ;)

When I use tell flash to get the varibles from an external .txt file, it will grab the text I put in the text file. However...is there a way to do certain things with that text?

Is there a way to insert links, change font, color, for that text? Can you tell an image to load within that text box along with the text?

If anyone could list all the little tricks you can do with using a external text file to update text within flash, please do so :)
0
Comment
Question by:Vikarou
[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
3 Comments
 
LVL 1

Expert Comment

by:Dr_Snipple
ID: 6221964
you can't load an image but you can insert links.
You have to use the ahref Tag in your .txt file.

Dr_Snipple
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 6223569
As long as the text field is a HTML type.

John.
0
 
LVL 3

Accepted Solution

by:
jeffbeasley earned 75 total points
ID: 6224748
Actually there are a few ways to load external images using a text file.

First import your images into separate Fla files (with size equal to picture size) then export the swf.(by saving your images this way you are able to choose which images to import)

Next, create a text file with your variable
my_images=pic1.swf,pic2.swf,pic3.swf

Next open main FLA and load text file in frame 1
loadVariables ("text.txt", my_images);

Next put functions in frame 1

function string_clean(symbol, stringin) {
var arrayout = new Array();
n = 1;
for (i=0; i<stringin.length; i++) {
if (stringin.charAt(i) != symbol) {
arrayout[n] = arrayout[n]+stringin.charAt(i);
} else if (stringin.charAt(i) == symbol) {
n++;
}
}
return (arrayout);
}


Next call function to separate image swf files into array element (send function separating element and variable loaded)
image_array=new Array();
image_array=string_clean(",",my_images);
//this sets image_array[0]=pic1.swf;
//image_array[1]=pic2.swf .....


Next, determine where you want your images. Create a MC with instance named movie_target and in frame 3 call
loadMovieNum (image_array[1], movie_target);

This is one possible way if you need cleaner code let me know or a sample file, You can also load certain HTML text files with limited HTML commands, but you cannot load an external image saved as a gif or jpeg.

I typed this out in the comment space allotted, so there may be a few syntax errors
Jeff
jeffbeasley.com
straxis.com

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 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 …
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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 select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

705 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