How do I set the dataProvider for an component to be an XML file?

后端 未结 5 1110
孤城傲影
孤城傲影 2021-01-16 13:51

I\'ve got the latest Beta of Adobe Flash Builder 4.

I want to use a component, and specify the dataProvider as being an XML

5条回答
  •  耶瑟儿~
    2021-01-16 13:56

    My original aim was to have an XML file external to the SWF that my client could maintain themselves, and thus they would have control over the images displayed.

    The first answer I posted was not quite the solution I was after: using fx:XML means that the contents of the XML file is actually compiled into the SWF, and hence is not alterable after compilation.

    So I've implemented James' solution.

    The XML file looks like this:

    
    
    
        
        
        
        
    
    

    MXML:

    
    
    
    
        
            
    
        
    
        
    
            
    
        
    
        
    
            
                
            
    
        
    
    
    

    And in the image renderer, I refer to the data like this:

    
    

    The really useful thing about this solution is that I can also put full http:// references to images that exist on another site if I want to (remembering crossdomain.xml, of course).

    In fact, the images.xml file can exist on another server.

提交回复
热议问题