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
147 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
Comment Utility
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
Comment Utility
As long as the text field is a HTML type.

John.
0
 
LVL 3

Accepted Solution

by:
jeffbeasley earned 75 total points
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

771 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

7 Experts available now in Live!

Get 1:1 Help Now