Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error 2124 with XML files

New Here ,
Oct 01, 2017 Oct 01, 2017

I am attempting to load an XML file using AS3.  I have seen several topics similar to my question, but none seem to fit my situation.   My code snippets follow.

       

        public function loadDirectory():void  {

            trace("THERE")   

            var setUpLoader:URLLoader = new URLLoader();

            setUpLoader.addEventListener(Event.COMPLETE, setupLoaded);

            setUpLoader.load(new URLRequest("xml/setup.xml"));

        }

        private function setupLoaded(e:Event)  {

            _setUpXML = XML(e.target.data);

            trace("HERE "+_setUpXML)

            completeLoading();

        }

Between the THERE trace and the HERE trace, I get the following error messages:

Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.

Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.

The initial snippet of my XML file is:

<?xml version="1.0" encoding="utf-8"?>

<setUp>

    <setdata rootdir="http://aln.coe.ttu.edu/anderson/T-Model11-0/" server="true" />

    <fonts> Arial,Helivetica,_sans </fonts>                    //--Font

    <fontsize> 12 </fontsize>                                //--Font size (Do not change)

The threads I have followed suggest the problem is using a Loader rather then a URLLoader.  But, my code uses the URLLoader.  Any suggestions are appreciated.

TOPICS
ActionScript
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 01, 2017 Oct 01, 2017
Translate
Community Expert ,
Oct 01, 2017 Oct 01, 2017

check if your xml is malformed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 01, 2017 Oct 01, 2017

It actually comes through and the remaining code processes it as properly formed XML when I compile my code.  But, when I load the complied (swf) files on a server and execute them through a browser, it locks up.  I think this error is locking up the browser.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2017 Oct 01, 2017

Add a listener for the IOErrorEvent, that might give you more details. Also set Allow Debugging in Publish Settings, so you can see the line number where the error happens. You could also then do a debug test movie, and see what the variables contain.

Here's the IOError listener:

setUpLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

and:

private function ioErrorHandler(event:IOErrorEvent):void {

  trace("ioErrorHandler: " + event);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 01, 2017 Oct 01, 2017

When I added your code, I got nothing.  But when I turned on the debugger, I got:

*** Security Sandbox Violation ***

Connection to http://aln.coe.ttu.edu/anderson/T-Model11-0/spages/authorize.cfm?UName=guest&passWord=guest halted - not permitted from file:///C|/Users/Ed%20Anderson/Documents/T%2DModel11%2D0/tmodel11%2D0.swf

-- Untrusted local SWFs may not contact the Internet.

SecurityError: Error #2028: Local-with-filesystem SWF file file:///C|/Users/Ed%20Anderson/Documents/T%2DModel11%2D0/tmodel11%2D0.swf cannot access Internet URL http://aln.coe.ttu.edu/anderson/T-Model11-0/spages/authorize.cfm?UName=guest&passWord=guest.

    at flash.net::URLStream/load()

    at flash.net::URLLoader/load()

    at Login::Login/submitLogin()

Cannot display source code at this location.

Debug session terminated.

It appears that I have some sort of security issue.  Any ideas?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 01, 2017 Oct 01, 2017
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 02, 2017 Oct 02, 2017

Thanks!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2017 Oct 02, 2017
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines