How to load PHP dynamically generated XML in FLASH

后端 未结 3 1126
旧巷少年郎
旧巷少年郎 2021-01-20 20:18

Question Updated for Bounty

In Flash I need to load a dynamically generated XML file, which is created using PHP.

I\'m using the [Bulk-loader librar

相关标签:
3条回答
  • 2021-01-20 20:49

    try put this code in the first line of you php file:

    header ("content-type: text/xml");
    
    0 讨论(0)
  • 2021-01-20 21:04

    From your output:

    Error #1088: The markup in the document following the root element must be well-formed.
    

    It seems that the problem is not with the loader but with the PHP output. Check to make sure your output looks as expected by accessing the generated XML directly from your browser and downloading it. You may be able to spot the error in the output if you go through it in a text editor line-by-line, or you could try using an XML editor and see if it finds issues.

    0 讨论(0)
  • 2021-01-20 21:05

    Are you sure you have put type:"XML" within the add of bulkloader in your online test TEN.swf, since i have an error when running it from your PHP file ?

    Edit:

    Reading the bytecode from your previous TEN.swf show that the xml type was not put:

    0x000076  [ 0xd0 ]       GetLocal0                                                                
    0x000077  [ 0x66 ]       GetProperty          QName(PrivateNamespace(""), "theXML")                                                    
    0x00007a  [ 0x2c ]       PushString           "id"                                                    
    0x00007d  [ 0x2c ]       PushString           "xmldata"                                                    
    0x000080  [ 0x55 ]       NewObject            1                                                    
    0x000082  [ 0x4f ]       CallPropVoid         QName(PackageNamespace(""), "add"), 2                                                    
    

    Now it seems to work and showing the bytecode show that the xml type was added

    0x000076  [ 0xd0 ]       GetLocal0                                                                
    0x000077  [ 0x66 ]       GetProperty          QName(PrivateNamespace(""), "theXML")                                                    
    0x00007a  [ 0x2c ]       PushString           "id"                                                    
    0x00007d  [ 0x2c ]       PushString           "xmldata"                                                    
    0x000080  [ 0x2c ]       PushString           "type"        <===== here it is now                                            
    0x000083  [ 0x2c ]       PushString           "xml"         <=====                                           
    0x000086  [ 0x2c ]       PushString           "maxTries"                                                    
    0x000089  [ 0x24 ]       PushByte             0x6                                                    
    0x00008b  [ 0x2c ]       PushString           "preventCache"                                                    
    0x00008e  [ 0x26 ]       PushTrue                                                                 
    0x00008f  [ 0x55 ]       NewObject            4                                                    
    0x000091  [ 0x4f ]       CallPropVoid         QName(PackageNamespace(""), "add"), 2                                                    
    
    0 讨论(0)
提交回复
热议问题