Subscribe to Collegiate Chronicles        RSS Feed
-----

Flash: Dynamic Text

Icon Leave Comment
Looking for an easier way to update site information or change fonts or text colors and sizes in your Flash site?
This is one possible solution:

First, create a text file containing your link names and site text:

&txt1var=Link 1
&txt2var=Link 2
&txt3var=Link 3
&txt4var=Link 4


&files1=<font face="Arial"><font size="15"><font color="#003060">
Add text here.  With wordwrap and multiline functions enabled in the ActionScript, this text should wrap around the text area as it would in a CSS container on an HTML page.  With HTML set to True, the bracketed information on font sizes and colors should also work in your Flash presentation.

&files2=<font face="Tahoma Bold"><font size="25"><font color="#ff0000">
Add a bunch of junk related to your second link here.

&files3=<font face="Impact"><font size="15"><font color="#ff00ff">
Add more junk related to your third link here.

&files4=<font face="Arial"><font size="12"><font color="#003060">
Add junk related to your fourth link here.  And so on and so forth.....


Then add the following ActionScript to your Flash frames:

loadVariables("text.txt",_root);
_root.createTextField("frmInfo",1,169,60,362,361);
frmInfo.multiline = true;
frmInfo.wordWrap = true;
frmInfo.border = false;
frmInfo.html = true;
frmInfo.type = dynamic;
frmInfo.selectable = false;
frmInfo.background = false;
frmInfo.font = "Courier New";
frmInfo.variable = "files1";
stop();


Change the variable in the ActionScript for each frame (ie, "files1", "files2", ..."files853"..., etc.) to point to the variable name in the text file containing the information you want to appear in that frame.

To dynamically load the link names, you will need a button with a dynamic text area on top. In the sample linked below, I used green background rectangles for my buttons. Be sure your text area variable names are set to the same variables used in the text file (in this example "txt1var", "txt2var"....) and set each button action to go to the frame you would like them to display (ie, when you press button 2, it goes to frame 2, etc). The font size, style and color for the dynamic text areas need to be changed in the element's properties in Flash. You cannot use the text file to change these details for dynamic text.

I hope this makes sense as I am horrible at explaining things.... I am hoping the blog will help me to improve this very weak skill.

Anyway, you can see this technique in action here.

0 Comments On This Entry

 

April 2019

S M T W T F S
 123456
78910111213
14151617181920
2122 23 24252627
282930    

Recent Entries

Recent Comments

Search My Blog

0 user(s) viewing

0 Guests
0 member(s)
0 anonymous member(s)