A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [RESOLVED] CS4 AS3 - Loading ASP generated XML

  1. #1
    Senior Member Ex-Ess's Avatar
    Join Date
    Nov 2002
    Location
    York (England)
    Posts
    588

    resolved [RESOLVED] CS4 AS3 - Loading ASP generated XML

    Keep getting this error when trying to load some asp generated xml into flash:

    Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://evildesign/gallery.asp
    at com::loadXML()
    at mc_gallery_thumbs/frame1()
    at flash.display::MovieClip/gotoAndPlay()
    at mc_menu/changePage()
    at MethodInfo-194()

    any ideas why?

    If I copy and paste the source code of the asp page into an xml file it works fine.

    Cheers

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Load the asp page in your browser. See whether it looks right, or whether there is an asp error generated. Flash does not care how the xml is generated, as long as it's correct.
    If the asp actually generates xml, you may have to explicitly set the mime-type.

  3. #3
    Senior Member Ex-Ess's Avatar
    Join Date
    Nov 2002
    Location
    York (England)
    Posts
    588
    Like I said if I copy and paste the source code of the asp page into an xml file it works fine.

    And if I look at the page the xml looks fine.

    Code:
    <%
    Response.ContentType = "text/xml"
    Response.Write "<?xml version=""1.0""?>"
    
    Set oFs = Server.CreateObject("Scripting.FileSystemObject")
    FullPath = Server.MapPath(".")&"\gallery"
    
    If oFs.FolderExists(FullPath) Then
    	Set oFolder = oFs.GetFolder(FullPath)
    	
    	output = "<Images>"
    	For Each oFile In oFolder.Files
    		if oFile.Name <> "Thumbs.db" Then
    			output = output & "<Image>"
    			' Loop through the fields in each record.
    			  strName  = oFile.Name
    			  If Len(strName)  > 0 Then strName = Server.HTMLEncode(strName)
    			  output = output & "<Url>" & strName & "</Url>"
    			' Move to next record in database.
    			' Output end of record.
    			output = output & "</Image>"
    		End If
    	Next
    	
    	output = output & "</Images>"
    	
    	Response.Write output
    End If
    %>
    thats the code that generates it. I have set the content type at the top already.

    Thanks for help

    Any ideas?!

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    I take it by "source code of the asp page" you actually mean the output of the asp page. What you have pasted above is the actual source code of the asp page. The output of the asp page is what's relevant.
    Although I don't know asp, it appears that that output would look like:
    Code:
    <?xml version="1.0"?>
    <Images>
    <Image>
    <Url>somecontent</Url>
    </Image>
    </Images>
    Which, other than lacking indentations, looks fine.

    Other things to check: Are you positive that the url you are attempting to load is correct? Is it on the same domain as the swf? If it's not, does the domain with the asp page have an appropriate crossdomain.xml file?

    Check out this blog post on the error you recieved:
    http://www.judahfrangipane.com/blog/?p=87

  5. #5
    Senior Member Ex-Ess's Avatar
    Join Date
    Nov 2002
    Location
    York (England)
    Posts
    588
    I mean what is generated looks fine and like XML should. URL is fine and in the same place as the swf.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center