2 Replies Latest reply on Oct 20, 2009 4:49 PM by fix_flash

    Bug when save area flash to image on server

    fix_flash

      hi all,

       

      I've a problem when save area flash to image on server (both Win or Linux), but on local (OS: Window) it allaway runs well. I try to find this bug, when user "loadMovie" function it's bug, but i don't use "loadMovie" function it runs well (on Sever)

       

      source below:

       

       

      /**
      * Print Button has been clicked
      */
      function print_me(){
          trace("printing...");
        
          var _loc4 = new flash.display.BitmapData(300,300, false);
          _loc4.draw(this);
          my_mc = _root.snap_mc;
          my_mc.cont_mc.attachBitmap(_loc4, 5, "auto", true);
          my_mc.cont_mc._width = 200;
          my_mc.cont_mc._yscale = my_mc.cont_mc._xscale;
          var _loc2 = new flash.display.BitmapData(my_mc._width, my_mc._height, false);   
          _loc2.draw(my_mc);
          myclr = "";
          for (i = 0; i < _loc2.width; i++)
          {
              for (j = 0; j < _loc2.height; j++)
              {
                  clr = _loc2.getPixel(i, j).toString(16); // cannot get color of this pixel when it runs on server(all away return FFFFFF - white) , but on local it runs well
                  myclr = myclr + (clr + ",");
              } // end of for
          } // end of for
         
          var _loc3 = new LoadVars();
          _loc3.w = _loc2.width;
          _loc3.h = _loc2.height;
          _loc3.clr = myclr;
           _root.result_.text    = myclr;

           // send php save image
            _loc3.sendAndLoad("http://example.com/save_image.php", _loc3, "post");
           
        
      }

       

       

       

      var mclListener:Object = new Object();
      mclListener.onLoadStart = function(target_mc1:MovieClip) {
         trace("start");
      };
      mclListener.onLoadComplete = function(target_mc1:MovieClip) {
        trace("complete");
      //abc();
          
      };
      mclListener.onLoadInit = function(target_mc1:MovieClip) {
         trace("onLoadInit");
          // Print when load image completed
          print_me();

      };
      mclListener.onLoadError = function(target_mc1:MovieClip) {
         trace("error");
       
         
      };
      var image_mcl:MovieClipLoader = new MovieClipLoader();
      image_mcl.addListener(mclListener);
      _root.mc.loadMovie('http://example.com/box_rose_frame.jpg');

       

      any body help?

      thanks