This tutorial will show you some ways in which Flash can use ActionScript to make use of external data sources.
Macromedia Flash is a very robust tool for creating multimedia applications for both the internet and other applications Itâ€™s use has been documented as widespread as the PlayStation 2â„¢ Incarnation of the game ridge racer. The key to this use of flash is being able to use flash with external data sources such as XML and text documents.
In this tutorial we will investigate how to create a text reading application for use as a guestbook this way you could create the application and instead of opening up flash you would be able to change the contents of the text file and have the page updated on the fly.
Before starting this tutorial you must ensure that you have at east Macromedia Flash MX these tutorials may work elsewhere but I can only guarantee their success within Flash MX and upwards.
Create a New flash Document in the standard document dimensions 550px width and 400px height.
Use the Text Tool to create a Dynamic Text Box with a variable name of text and the value Single Line change to Multiline.
Right Click the first Frame and select Actions from the context menu.
Use LoadVariable(â€œ./data/textfile.txtâ€, _root); and then stop(); in the ActionScript window then click the arrow to make the Actions screen disappear.
Now You can save the Flash source file and Export to an SWF file the flash part of this exercise is finished.
Now you need to go into windows explorer and create a folder with the name data in the directory that you saved your flash file to.
Inside this data directory create a file entitled textfile.txt with contents reading &text;=hello this is my file
Run your flash file and The text â€œhello this is my fileâ€ appears in the window.
Now you have an application that works you can change the font in the flash application or pretty much anything you desire. I hope this helps you to create future flash masterpieces.
Good Luck Guyz