0 Replies Latest reply on Dec 13, 2010 2:23 PM by ehurkan

    Resize  ( listener problem )

    ehurkan

      i am doing full screen website . but i have a problem.my codes and example website ;http://www.24de1.com/resize . i am taking background picture with xml.(mc name is "pic") picture resolution is 1920 x 1080 . if i minimize to browser, the backround image is broken... when i refresh the page, it's improving..

       

      Stage.align = "TL";
      Stage.scaleMode = "noScale";
      
      //define dynamic aspect ratios arkaplan başlangıcı
      
      picHeight = new Object ();
      picHeight = pic._height / pic._width;
      
      picWidth = new Object ();
      picWidth = pic._width / pic._height; 
      
      //conditional statement to account for various initial browswer sizes and proportions
      
      if ((Stage.height / Stage.width) < pic._Height) {
           pic._width = Stage.width;
           pic._height = picHeight * pic._width;
       } else {
           pic._height = Stage.height;
           pic._width = picWidth * pic._height;
      };     
      
      //center picture on stage
           
      pic._x = 0;
      pic._y = 0;
      
      
      // create listener
      sizeListener = new Object();
      // make listener change picture size and center picture on browser resize
      sizeListener.onResize = function() {
           
           if ((Stage.height / Stage.width) < picHeight) {
      
                pic._width = Stage.width;
                pic._height = picHeight * pic._width;
           } else {
                pic._height = Stage.height;
                pic._width = picWidth * pic._height;
           };     
           
           
      pic._x = 0;
      pic._y = 0;
           
      
      }
      
      Stage.addListener(sizeListener);
      //arkaplan bitişi
      
      
      
           byb._y = Stage.height -510;
           byb._x = Stage.width / 180;
           copy._y = Stage.height - 11;
           copy._x = Stage.width - 65;
           menu_bg._y = Stage.height -75;
           menu_bg._x = 275;
      
      
      
      var stageL:Object = new Object();
      stageL.onResize = function() {
      
           byb._y = Stage.height -510;
           byb._x = Stage.width / 180;
          copy._y = Stage.height - 11;
          copy._x = Stage.width - 65;
           menu_bg._y = Stage.height -75;
           menu_bg._x = 275;
      
      
      
      }
      
      Stage.addListener(stageL);
      
      
      
      
      
      Thanks dear friends