aharui commented on issue #838:
URL: https://github.com/apache/royale-asjs/issues/838#issuecomment-635823196


   Here's the app using DownloadButton that I just pushed:
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                           xmlns:s="library://ns.apache.org/royale/spark"
                           xmlns:mx="library://ns.apache.org/royale/mx"
                           paddingBottom="0" paddingTop="0" paddingLeft="0" 
paddingRight="0"
                           height="100%" width="100%" 
                           creationComplete="setupDownload()">
        
        <fx:Script>
                <![CDATA[
                        
                        import mx.net.FileReference;
                        import mx.events.MenuEvent;
                        
                        
                        protected function setupDownload():void {
                                downloadButton.defaultFileName = 
"pinaraexport.xml";
                                downloadButton.data = menuDataXMLList.toString()
                                //var fileReference:FileReference = new 
FileReference();
                                
//fileReference.save(menuDataXMLList.toString(), "pinaraexport.xml");
                        }
                        
                ]]>
        </fx:Script>
        
        <fx:Declarations>
                <fx:XMLList id="menuDataXMLList">
                        <menuitem label="label-1">                      
                                <menuitem label="label-1-1"/>                   
                                <menuitem label="label-1-2"/>                   
                        </menuitem>
                        <menuitem label="Switch Locale" id="admin" >            
        
                                <menuitem label="label-2-1"/>                   
                                <menuitem label="label-2-2"/>                   
                                <menuitem label="label-2-3" id="admin" />
                        </menuitem>
                </fx:XMLList>
        </fx:Declarations>      
        
        <s:layout>
                <s:VerticalLayout gap="10" paddingRight="10" paddingLeft="10" 
paddingTop="10" paddingBottom="20" />
        </s:layout>
   
        <mx:DownloadButton label="Save XML" id="downloadButton"/>
        
   </s:Application>
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to