2 Replies Latest reply on Oct 10, 2006 2:07 AM by danredman

    want to smooth loaded images (jpg) in flash8

      i want to smooth loaded images (jpg) in flash8

      let's say that i have one layer, one frame and the following AS:
      _root.loadMovie("q.jpg");

      the _root could be an object, but the behavior is the same

      so in flash7 CTRL+ENTER, right click and zoom ---> RESULT: zoom with image interpolation (like photoshop bicubic resample)
      but in flash8 CTRL+ENTER, right click and zoom ---> RESULT: zoom with NO image interpolation (like photoshop nearest nei ghbor resample)

      why?????

      i have looked in help but all i can find is somthing refering about images in the library. I want external jpgs!!!
      i have done a slideshow with setable tranzitions (fade, blur, moving, zoom in/out, external loaded masking)


      here is some the important part of the my code (not important for my problem, but I just want to say that i've worked about 1-2 days and i want to make it better. is frustating that i have blur, fade, gradient transparency (blending) and not a smooth image):
      ////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////
      Gtime=getTimer(); //global timmer

      ///////////////////////////////ia datele generale, daca cele particulare lipsesk
      /*Ttrans=eval("q.tt")-0;*/ if(eval("q.tt"+pidx))Ttrans=eval("q.tt"+pidx)-0;
      /*Tfoto=eval("q.tf")-0;*/ if(eval("q.tf"+pidx))Tfoto=eval("q.tf"+pidx)-0;
      /*sv=eval("q.sv")-0;*/ if(eval("q.sv"+pidx))sv=eval("q.sv"+pidx)-0;
      /*sk=eval("q.sk")-0;*/ if(eval("q.sk"+pidx))sk=eval("q.sk"+pidx)-0;
      /*xv=eval("q.xv")-0;*/ if(eval("q.xv"+pidx))xv=eval("q.xv"+pidx)-0;
      /*yv=eval("q.yv")-0;*/ if(eval("q.yv"+pidx))yv=eval("q.yv"+pidx)-0;
      /*xk=eval("q.xk")-0;*/ if(eval("q.xk"+pidx))xk=eval("q.xk"+pidx)-0;
      /*yk=eval("q.yk")-0;*/ if(eval("q.yk"+pidx))yk=eval("q.yk"+pidx)-0;
      /*rv=eval("q.rv")-0;*/ if(eval("q.rv"+pidx))rv=eval("q.rv"+pidx)-0;
      /*rk=eval("q.rk")-0;*/ if(eval("q.rk"+pidx))rk=eval("q.rk"+pidx)-0;
      /*xbk=eval("q.xbk")-0;*/ if(eval("q.xbk"+pidx))xbk=eval("q.xbk"+pidx)-0;
      /*ybk=eval("q.ybk")-0;*/ if(eval("q.ybk"+pidx))ybk=eval("q.ybk"+pidx)-0;
      /*xbv=eval("q.xbv")-0;*/ if(eval("q.xbv"+pidx))xbv=eval("q.xbv"+pidx)-0;
      /*ybv=eval("q.ybv")-0;*/ if(eval("q.ybv"+pidx))ybv=eval("q.ybv"+pidx)-0;
      /*mask=eval("q.mask");*/ if(eval("q.mask"+pidx))mask=eval("q.mask"+pidx);
      /////////////////////////////////////////////////////////////////////////////////


      if(trans==0 && Gtime>Ftime+Tfoto*1000){
      //retain values
      aux2=(Gtime-Ttime)*100/((Ttrans*2+Tfoto)*1000);
      Ttrans2=Ttrans;
      Tfoto2=Ttrans;
      sv2=sv;sk2=sk;
      xv2=xv;yv2=yv;
      xk2=xk;yk2=yk;
      rv2=rv;rk2=rk;
      xbv2=xbv;ybv2=ybv;
      xbk2=xbk;ybk2=ybk;
      //end retain values
      Ttime=Gtime;
      trans=1;//transition

      if(p=="p1"){
      p="p2";pp="p1";
      }else{
      p="p1";pp="p2";
      }
      pidx++;
      if(eval("q.p"+pidx)==undefined){
      end=1;
      //gotoAndStop(6);
      }else{
      p1.swapDepths(p2);
      loadMovie(fotofolder+eval("q.p"+pidx),eval(p+".p.p"));
      eval(p)._xscale=eval(p)._yscale=100;
      eval(p)._rotation=0;
      }
      }
      if(trans==1 && Gtime>Ttime+Ttrans*1000){
      Ftime=Gtime;
      trans=0;//not transition
      }
      //tranzition

      if(trans==1){
      if(mask.length>3)
      eval(p)._alpha=100;
      else
      eval(p)._alpha=(Gtime-Ttime)*100/(Ttrans*1000);
      }
      aux=(Gtime-Ttime)*100/((Ttrans*2+Tfoto)*1000)
      eval(p)._x=xv*aux+xk;
      eval(p)._y=yv*aux+yk;
      eval(p)._xscale=eval(p)._yscale=sv*aux+100+sk;
      eval(p)._rotation=rv*aux+rk;
      blur.blurX=aux*xbv+xbk;
      blur.blurY=aux*ybv+ybk;
      eval(p).p.p.filters = [blur];
      //intarzierea
      aux=aux+aux2;
      eval(pp)._x=xv2*aux+xk2;
      eval(pp)._y=yv2*aux+yk2;
      eval(pp)._xscale=eval(pp)._yscale=sv2*aux+100+sk2;
      eval(pp)._rotation=rv2*aux+rk2;

      if(!end)gotoAndPlay(_currentframe-1);
      ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////
        • 1. Re: want to smooth loaded images (jpg) in flash8
          Level 7
          See http://www.kaourantin.net/2005/12/dynamically-loading-bitmaps-with.html

          danredman wrote:
          > i want to smooth loaded images (jpg) in flash8
          >
          > let's say that i have one layer, one frame and the following AS:
          > _root.loadMovie("q.jpg");
          >
          > the _root could be an object, but the behavior is the same
          >
          > so in flash7 CTRL+ENTER, right click and zoom ---> RESULT: zoom with image
          > interpolation (like photoshop bicubic resample)
          > but in flash8 CTRL+ENTER, right click and zoom ---> RESULT: zoom with NO image
          > interpolation (like photoshop nearest nei ghbor resample)
          >
          > why?????
          >
          > i have looked in help but all i can find is somthing refering about images in
          > the library. I want external jpgs!!!
          > i have done a slideshow with setable tranzitions (fade, blur, moving, zoom
          > in/out, external loaded masking)
          >
          >
          > here is some the important part of the my code:
          >
          > Gtime=getTimer(); //global timmer
          >
          > ///////////////////////////////ia datele generale, daca cele particulare
          > lipsesk
          > /*Ttrans=eval("q.tt")-0;*/ if(eval("q.tt"+pidx))Ttrans=eval("q.tt"+pidx)-0;
          > /*Tfoto=eval("q.tf")-0;*/ if(eval("q.tf"+pidx))Tfoto=eval("q.tf"+pidx)-0;
          > /*sv=eval("q.sv")-0;*/ if(eval("q.sv"+pidx))sv=eval("q.sv"+pidx)-0;
          > /*sk=eval("q.sk")-0;*/ if(eval("q.sk"+pidx))sk=eval("q.sk"+pidx)-0;
          > /*xv=eval("q.xv")-0;*/ if(eval("q.xv"+pidx))xv=eval("q.xv"+pidx)-0;
          > /*yv=eval("q.yv")-0;*/ if(eval("q.yv"+pidx))yv=eval("q.yv"+pidx)-0;
          > /*xk=eval("q.xk")-0;*/ if(eval("q.xk"+pidx))xk=eval("q.xk"+pidx)-0;
          > /*yk=eval("q.yk")-0;*/ if(eval("q.yk"+pidx))yk=eval("q.yk"+pidx)-0;
          > /*rv=eval("q.rv")-0;*/ if(eval("q.rv"+pidx))rv=eval("q.rv"+pidx)-0;
          > /*rk=eval("q.rk")-0;*/ if(eval("q.rk"+pidx))rk=eval("q.rk"+pidx)-0;
          > /*xbk=eval("q.xbk")-0;*/ if(eval("q.xbk"+pidx))xbk=eval("q.xbk"+pidx)-0;
          > /*ybk=eval("q.ybk")-0;*/ if(eval("q.ybk"+pidx))ybk=eval("q.ybk"+pidx)-0;
          > /*xbv=eval("q.xbv")-0;*/ if(eval("q.xbv"+pidx))xbv=eval("q.xbv"+pidx)-0;
          > /*ybv=eval("q.ybv")-0;*/ if(eval("q.ybv"+pidx))ybv=eval("q.ybv"+pidx)-0;
          > /*mask=eval("q.mask");*/ if(eval("q.mask"+pidx))mask=eval("q.mask"+pidx);
          >
          > ////////////////////////////////////////////////////////////////////////////////
          > /
          >
          >
          > if(trans==0 && Gtime>Ftime+Tfoto*1000){
          > //retain values
          > aux2=(Gtime-Ttime)*100/((Ttrans*2+Tfoto)*1000);
          > Ttrans2=Ttrans;
          > Tfoto2=Ttrans;
          > sv2=sv;sk2=sk;
          > xv2=xv;yv2=yv;
          > xk2=xk;yk2=yk;
          > rv2=rv;rk2=rk;
          > xbv2=xbv;ybv2=ybv;
          > xbk2=xbk;ybk2=ybk;
          > //end retain values
          > Ttime=Gtime;
          > trans=1;//transition
          >
          > if(p=="p1"){
          > p="p2";pp="p1";
          > }else{
          > p="p1";pp="p2";
          > }
          > pidx++;
          > if(eval("q.p"+pidx)==undefined){
          > end=1;
          > //gotoAndStop(6);
          > }else{
          > p1.swapDepths(p2);
          > loadMovie(fotofolder+eval("q.p"+pidx),eval(p+".p.p"));
          > eval(p)._xscale=eval(p)._yscale=100;
          > eval(p)._rotation=0;
          > }
          > }
          > if(trans==1 && Gtime>Ttime+Ttrans*1000){
          > Ftime=Gtime;
          > trans=0;//not transition
          > }
          > //tranzition
          >
          > if(trans==1){
          > if(mask.length>3)
          > eval(p)._alpha=100;
          > else
          > eval(p)._alpha=(Gtime-Ttime)*100/(Ttrans*1000);
          > }
          > aux=(Gtime-Ttime)*100/((Ttrans*2+Tfoto)*1000)
          > eval(p)._x=xv*aux+xk;
          > eval(p)._y=yv*aux+yk;
          > eval(p)._xscale=eval(p)._yscale=sv*aux+100+sk;
          > eval(p)._rotation=rv*aux+rk;
          > blur.blurX=aux*xbv+xbk;
          > blur.blurY=aux*ybv+ybk;
          > eval(p).p.p.filters = [blur];
          > //intarzierea
          > aux=aux+aux2;
          > eval(pp)._x=xv2*aux+xk2;
          > eval(pp)._y=yv2*aux+yk2;
          > eval(pp)._xscale=eval(pp)._yscale=sv2*aux+100+sk2;
          > eval(pp)._rotation=rv2*aux+rk2;
          >
          > if(!end)gotoAndPlay(_currentframe-1);

          >
          • 2. Re: want to smooth loaded images (jpg) in flash8
            Level 1
            my target objects are under masks and blended, not working, must tune more...

            but the solution for loading smooth bitmaps is good