0
votes

Hi im trying to learn flash actionscript 3.0 basically i just want to learn how to put 1 simple picture into a flash document using XML so far ive got

<Gallery>
<IMAGE TITLE="Picture">Desert.jpg</IMAGE>
</Gallery>

thats my XML code DESERT is a picture on my laptop from the sample pictures

import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;

var myXML:XML;
var imageLoader:URLLoader = new URLLoader();
imageLoader.load(new URLRequest("pictest.xml"));
imageLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void {
myXML = new XML(e.target.data);
trace(myXML);

this is my flash code when i run it i get a ton of errors which im confused about im new to this so any help would be appreciated also the myLoader is a textarea box with the instance name imageLoader

compiller errors im getting are :

A conflict exists with the definition myXML in namespace internal

A conflict exists with the definition imageLoader in namespace internal

duplicate function definition

Thanks in advance Rhys

1

1 Answers

0
votes

What all these errors say is that you have written your code (same code you posted) more then once. In AS3 it is illegal (semi-legal in certain circumstances) to declare same variable or function more then once in the same scope - this is why you get the error.

So, check that other frames don't declare myXML, imageLoader and processXML again.