4 Replies Latest reply on Jul 23, 2010 6:14 PM by Bob Saggot

    Large photos freeze flash player, example file included.

    Bob Saggot Level 1

      This was working with Flash 10, but 10.1 kills it  I am not sure if its the server or client side that makes it freeze.

       

      File is located at

      http://laceybrowne.com/broke.fla

       

      Thanks!

       

      also posting the code at the bottom for people who can't download

       

      import flash.display.BitmapData
      stop();
      
      var aScene:Array = []
      var aSceneWidth:Array = []
      var aSceneHeight:Array = []
      nCanvasWidth = Stage.width-50
      nCanvasHeight = Stage.height
      nCanvasRatio = nCanvasWidth / nCanvasHeight;
      
      aScene[0] = this.createEmptyMovieClip('scene', 1);
      var oLoader:MovieClipLoader = new MovieClipLoader()
      oLoader.addListener(this); //use the main timeline to listen and respond to oLoader's broadcast events
      
      //sScenePath = "http://laceybrowne.com/8702373.jpg"//works
      sScenePath = "http://laceybrowne.com/8964867.jpg"//doesn't work, freezes everything in flash player 10.1
      
      oLoader.loadClip(sScenePath, aScene[0])
      
      function onLoadInit(_mc:MovieClip)
      {
           _mc.forceSmoothing = true;
           _mc._quality = "BEST";
                     
           if(_mc._name == "scene")
           {
                     // transfer image to bitmap object
                     aScene[0]._x = 0
                     aScene[0]._y = 0
                     aSceneWidth[0] = _mc._width
                     aSceneHeight[0] = _mc._height
           }
           else
           {
                _mc._height = 50;
                _mc._width = 50;
           }
      }
      
      function setSceneSizes(i)
      {
           var nWidth = aSceneWidth[i];
           var nHeight = aSceneHeight[i];
           if(nWidth/nHeight < nCanvasRatio)
           {
                
                var nStartWidth = nCanvasWidth;
                var nStartHeight = (nHeight / nWidth) * nCanvasWidth;
           }
           else
           {
                var nStartWidth = (nWidth / nHeight) * nCanvasHeight;
                var nStartHeight = nCanvasHeight;
           }
           
           aScene[0]._width = nStartWidth;
           aScene[0]._height = nStartHeight;
      }