dalehay.com
Search Engine Optimization

Read From A Text File in SWiSHmax

Digg! This Page
Step 1
Create a new movie. Make its size roughly 480 by 320, with a frame rate of 12.
SWiSHmax

Step 2
Select the text tool SWiSHmax and draw a textbox on your palette. Make it dynamic text and vector font. Then for each of the options use the following options.
SWiSHmaxSWiSHmaxSWiSHmax
Make sure you have named the text field as "message" and on the advanced option make the varible name as "mymessage"

Step 3
Now right click the textfield in the "Outline" and choose Grouping -> Group As Sprite.
SWiSHmax

Step 4
With the "sprite" selected in the "Outline" menu select "Script" in the layout palette and now we need to make the script read from a text file. So to do that change the Script mode to Expert and first set the script to start when the flash file loads.
onLoad () {

}
Step 5
Now with the script starting when the flash file loads, we need to tell it to read the text file. To do that we need to use this line.
    this.loadVariables("dalehay.txt");
Here is a breakdown of that line, just incase you're myth'd about it. "this" basically means this flash file and "loadVaribles("dalehay.txt");" means load all the varibles (of which the one we're using is "mymessage") also the filename is basically the text file where the varibles are stored.

Step 6
So altogether that should look like this.
onLoad () {
    this.loadVariables("dalehay.txt");
}
That is all for that. So File -> Export -> SWF + HTML and save it to your desktop.

Step 7
Finally create a text file in the same place as the SWF and HTML files and name it whatever you picked for the "loadVariables" bit. For mine I'd use dalehay.txt and within your text file you need to start it with.
&mymessage=
Everything starts with a ampersand then it's followed by the varible name then an equals sign. After the equals sign is what will get sent through from the text file to the flash file. After it place one more ampersand (&), so it should look something like this.
&mymessage=Hello everyone, my name is Dale Hay&
Step 8
Save the text file and upload (or view it on your computer) and you should get something like this.
SWiSHmax

Comments

Comments:

Add your comment...

Your Name:

Your Email:

Your Comment:

Enter This Number:

(77654)


Note: Your IP address is saved into the database when you submit a comment. Any type of threatening behaviour will result in your ISP being contacted and legal action being taken place!





Latest News Stories
» BBC Breakfast Error...
» Fact about December 26th
» Creating a new online website idea
» Analog TV Website Pages
» Will It Blend?
» MTV to remake Rocky Horror Picture Show
Top Viewed Stories
» PHP Mini Message Board Tutorial (1166)
» PHP Search Engine Tutorial (431)
» Helen Willetts Pregnant? (213)
» Will It Blend? (185)
» Create your own Image Uploader (176)
» MTV to remake Rocky Horror Picture Show (160)
Most Commented Stories
» I like my DuMP (15)
» Create your own Image Uploader (15)
» PHP Mini Message Board Tutorial (9)
» I'm on Wikipedia! (7)
» Chocie Munchin Niece (6)
» Life on Mars... (6)