0 Replies Latest reply on Nov 11, 2009 3:29 AM by mfriasv

    html page to TitleWindow custom component

    mfriasv

      Hello all,

       

      I have a TitleWindow custom component to which I send a html page. Does anybody know why it doesn't work?

       

      This is what I send:

       

                          for (var i:Number = 0; i < sdeName.length; i++){
                             
                              if (sdeName.getItemAt(i)["label"] == item.label){
                                  item.label = sdeName.getItemAt(i)["data"];
                                  var url:String = "http://myserver/getMetadata/metadata.aspx?sdeFeatName="+item.label+"&"+"outFormat=ISO";
                                  item.label = sdeName.getItemAt(i)["label"];
                     
                     
                      var mycompMeta:popupMeta = new popupMeta();
                          mycompMeta.url = url;
                          mycompMeta.x = 100;
                          mycompMeta.y = 100;
                          //mycompMeta.formatpop = formatpop;
                          PopUpManager.addPopUp(mycompMeta,this.parentApplication as DisplayObject);
                          PopUpManager.centerPopUp(mycompMeta);

       

       

       

      TitleWindow:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" width="1100" height="800" showCloseButton="true" close="closeMe()">
          <mx:Canvas width="1068" height="700" backgroundColor="#FFFFFF" borderColor="#000000" borderStyle="solid">
          <mx:Script>
              <![CDATA[
                  import mx.events.CloseEvent;
                  import mx.managers.PopUpManager;
                  [Bindable]
                  private var _url:String;
                  private var _formatpop:String;
                  private var downloadURL:URLRequest = new URLRequest();
                  public function set url(value:String):void {
                      _url = value;
                  }
                  public function set formatpop(value:String):void {
                      _formatpop = value;
                  }
                  public function clickHandler(event:MouseEvent):void
                 {
                     var fileReference:FileReference = new FileReference();
                     downloadURL.url = _url;
                    
                     fileReference.download(downloadURL,"test.html");
                 }
                  public function closeWindow (event:MouseEvent):void
                 {
                     PopUpManager.removePopUp(this);
                 }
                
                  public function closeMe ():void
                 {
                     PopUpManager.removePopUp(this);
                 }
                
                
              ]]>
          </mx:Script>
      <mx:Image  source="{_url}"/>

      </mx:Canvas>
      <mx:HBox>
           <mx:Button label="Close" id="close" click="closeWindow(event)"/>
          <mx:Button label="Save" id="save" click="clickHandler(event)"/>
      </mx:HBox>
      </mx:TitleWindow>

       

      Regards,

      Manolo