topical media & game development

talk show tell print

lib-flex-ximpel-editor-net-ximpel-components-XmlView.mx

lib-flex-ximpel-editor-net-ximpel-components-XmlView.mx (swf ) [ flash ] flex


  <?xml version="1.0" encoding="utf-8"?>
  <!-- 
      This program is free software: you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation, either version 3 of the License.
  
      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.
  
      You should have received a copy of the GNU General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
  
          Javier Quevedo Fernández 05-2009.
  -->
  <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" showCloseButton="true"
           title="XML viewer"
           horizontalCenter="0"
           verticalCenter="0"
           width="450"
           height="600"
           creationComplete="init();" 
           close="{this.parent.removeChild(this)}">
           <mx:Script>
                   <![CDATA[
                           import net.ximpel.classes.Subject;
                           import net.ximpel.classes.InteractiveVideo;
                           import mx.controls.Alert;
                           
                           [Bindable]
                           public var interactiveVideo : InteractiveVideo;
                           
                           public function init():void{
                           // var _subject : Subject = interactiveVideo.subjects[0] as Subject;
                            
                            var xmlString : String = new String();
                            
                            for (var subjectO : Object in interactiveVideo.subjects){
                                    var _subject : Subject = interactiveVideo.subjects[subjectO] as Subject;
                                    xmlString= xmlString + _subject.toXML().toXMLString() + "\n";        
                            }
                            textArea.text = xmlString;
                           
                           }
                           
                           private function onCopyToClipBoard(event:Event):void{
                                   System.setClipboard(textArea.text);
                  Alert.show("Done");
                           }
                   ]]>
           </mx:Script>
           
  <mx:VBox width="100%" height="100%">
          <mx:TextArea id="textArea" width="100%" height="100%">
  
          </mx:TextArea>
          <mx:HBox>
                  <mx:Button label="Copy to Clipboard" click="onCopyToClipBoard(event)" />
          </mx:HBox>
  </mx:VBox>         
          
  </mx:TitleWindow>
  


(C) Æliens 18/6/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.