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
169 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 …
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…
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 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.

809 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