First, create your text file. Do this with a basic notepad. I am going to use the variable mymessage, so my .txt file would be formatted like this:
&mymessage= Hi, this is my message
Welcome to my site!
More stuff here and here
-----END&
Make sure to add the &'s at the beginning and end. Now just save your .txt file as text.txt(Also, check the .txt file in the download) Now open up your swishmax. Create a dynamic text file, name it message, click the target button and give it the variable of mymessage(or the same thing in your .txt file)..and add this code to your scene:
onLoad () {
loadVariablesNum("http://yourdomain.com/text.txt",0,'GET');
}
Please change the http://yourdomain.com/text.txt to your file, or you can keep it there, because I have a file that is uploaded there Now we will do the easiest part, the scroll buttons (Too hard to explain scrollbars or anything like that) So make a up button, with the code:
on (press) {
Message.scroll -= 1;
}
and a down button with the code:
on (press) {
Message.scroll += 1;
}
Both these refer to Message, which is what I put in the name of the text, not the variable. Hope this helps... Also, I would like to include this info from John: Also while your at it try altering the TEXT to the HTML format [in the "text" section select "Formatting" and then select " <> " "render text as HTML" ] ( much clearer text and then do things like add colour and links such as Swish Tutorials to the notepad text file..
Swishmax Externally Loaded .txt files
Posted by jon at 12:55 AM
Labels: SwishMax Examples, SwishMax Tutorials
Subscribe to:
Post Comments (Atom)
1 comments:
Please help....
Why can't i do this - it should be so simple.
I'm trying to create a column of buttons (seven in all), and then when the user presses 'button 1' then 'image one' appears on the right of it. Then if they press 'button 2', then 'image 2' will replace 'image 1' on the right, and so on.
That's it - BUT I CAN'T DO IT!!!!
Please help, you're my only hope!
Post a Comment