Skip to main content
May 7, 2009
Question

Gaaah! Can't figure this one out!

  • May 7, 2009
  • 2 replies
  • 457 views

Hi,

Would appreciate anyone's help  - I keep getting the ArgumentError: "Error #1063: Argument count mismatch on LoadXML(). Expected 1, got 0."

Usually this has to do with events or argumants passed in, but both seem fine to me. Does anyone have any ideas????

Here is the only code in the fla:

var URLString:String = "homepage_rollover_copy.xml";

var newXML = new LoadXML(URLString);

and here is the class related to the fla:

package {

    import flash.display.*;
    import flash.events.*;
    import flash.net.*;
    import flash.utils.*;
    import flash.xml.*;

    public class LoadXML extends MovieClip {

        public var _xml:XML;
        public var xmlReq:URLRequest = new URLRequest();
        public var xmlLoader:URLLoader = new URLLoader();
       
        public function LoadXML(thisURL:String){
            var url:String = thisURL;
            xmlReq = new URLRequest(url);
            xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
            loadXMLFile();
        }
        function loadXMLFile():void{
            xmlLoader.load(xmlReq);
        }
        function xmlLoaded(event:Event):void {
            _xml = new XML(xmlLoader.data);
            //xmlList = xml.children();
        }
        public function get xmlData():XML {
            return _xml;
        }

    }
}

thanks!

This topic has been closed for replies.

2 replies

May 7, 2009

Oh, snap - it was because I was making the fla the same class - instead of importing the class. Just wasn't thinking...also stuck my fingers into boling water...nto having a good day!

kglad
Community Expert
Community Expert
May 7, 2009

and, you misspelled "not".  the horrors never end.

kglad
Community Expert
Community Expert
May 7, 2009

you're not typing your LoadXML instance, but that won't cause that error and neither will anything else you posted.

May 7, 2009

kglad - thanks, you're right on both counts. I changed that line to :

var newXML:LoadXML = new LoadXML(URLString);

but still no good.