3 Replies Latest reply on Apr 30, 2009 10:56 AM by Jeff Swartz

    New Window, HTMLLoader.loadString image problem

    Anzrew

      Hello,

      I woudl like to load an image into a new window which I create, the image is accessable via the main application e.g. app:/images/notificationbg.png After creating the new window, the text and everything appears fine, but the image fails to load, I have tried not making it a background image and used <img src="images/notificationbg.png"> just to test it but still no luck.

       

      ////////////////////// Create Window /////////////////////

      var options = new air.NativeWindowInitOptions();
                  options.transparent = false;
                  //transparent windows must have the systemChrome set to none
                  options.systemChrome = air.NativeWindowSystemChrome.NONE;
                  options.type = air.NativeWindowType.LIGHTWEIGHT;

       

                  this.htmlLoader = air.HTMLLoader.createRootWindow(
                          false, //hidden
                          options,
                          false, //no scrollbars
                          bounds
                       );

       

      ////////////////////// Load the Image /////////////////////

      this.htmlLoader.loadString("<html>" +
      "<head><style type=\"text/css\">#notify { background: url('images/notificationbg.png') no-repeat; }</style></head>" +
      "<body><div id=\"notify\" style=\"width: 200px; height: 62px; padding-top: 34px; padding-left: 45px;\">"+this.template+"</div></body>"+                       "</html>");

       

      Any help would be much appreciated!

       

      Thanks,

      Andrew