is it possible to load text into a dynamic text field, and if yes how could i do this?
i’ve searched a few tutorials on dynamic text fields but it conecntrates on scrolling.
i would like unique text to load in the dynamic text field depending on which navigation button i click on.
(i.e. i click on “button1” and “blabla1” text appears in the text field. i click on “button2” and blabla2" text appears in the same text field.)
There are a couple of ways of doing this, but I’ll touch upon the basic method.
In your main timeline on one of the first frames, set some variables
myMsgOne=“Hi, how are you?”;
myMsgTwo=“Say my name, say my name.”;
myMsgThree=“the answer to life the universe and everything is 42”;
myMsgFour=“but what is the question?”;
Now, you have buttons (on the main timeline), with the following a/s
So… you’ve got a text file, I assume it has been formated correctly, but for the sake of newbies reading this, I’ll go over external text imported into Flash.
You can create text to be imported into Flash with a basic text editor, with the following format
&myFirstVariable=This is the text of my first variable&mySecondVariable=This is the text of my Second variable&myThirdVariable=This is the text of my Third variable&
we use & symbols at the beginning of each variable name, and then an equal sign to denote what the variable is equal too.
In this example we’ll say that we saved this as
“externalVariables.txt” and we’ve placed it in the same folder as the swf that is going to load it.
Now in the swf… in the first frame of the main timeline
loadVariables (“externalVariables.txt”);
this loads the txt file into the flash movie.
Now taking into account my post above, we could use this on the buttons.