Wikipedia:Reference desk/Computing: Difference between revisions
Content deleted Content added
Line 324:
A friend of mine asked me to create a website for his band. He said it doesn't need to be anything too fancy, although he'd like to have a flash site with it (I've already created an HTML alternative... or should it be XHTML?). My question is, how would I go about using XML files for the flash site? As in, how would I use a SWF "container" to display the content of various XML files? For example, if I had a button called "About" in flash, when clicked upon, it would call and parse the content from a corresponding external XML file, whereas it displays the members of the band, while clicking another button, say "Gigs", would load another XML file containing information about upcoming performances. How would I go about doing this? Thanks, [[User:vic93|<b><font color="#00ff00" size="3" face="Monotype Corsiva">''Valens''</font> <font color="#000000" face="Cambria Math">Impérial</font> <font color="ff0000" face="Century">Császár</font>]] [[User talk:vic93|<font color="#0000ff">93</font></b>]] 15:47, 22 July 2008 (UTC)
:Do you have Adobe/Macromedia Flash Professional? If you have Adobe Flash CS3 Professional, then I can help you. The following code is in ActionScript 3.0, so it won't work in Macromedia Flash 8 since that only does ActionScript 2.0. ActionScript 3.0 is very different from version 2.0. If you're not familiar with ActionScript, it's a lot like JavaScript. ActionScript is compiled into SWF files. First, create a new ActionScript 3.0 Flash file. Then create a text field and give it an instance name (''external_txt'' in the example below). Then, create a new layer called ''actions''. Then click on the first frame of actions and press F9. Then type this code:<
<pre>var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest = new URLRequest("html.txt");
Line 332:
}
textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, textLoaded);</pre></
= July 23 =
|