“Being the richest man in the cemetery doesn’t matter to me … Saying we’ve done something wonderful… that’s what matters to me.”

by Steve Jobs

Créer une vidéo Flash avec effet de reflet.

27 August 2006

Avec la class BitmapData on peut faire des miracle avec Flash, maintenant on va essayer d'insérer une vidéo et créer un reflet (style  iChat).

code :

  1. import  flash.display.BitmapData;
  2. var nc =  new NetConnection();
  3.         nc.connect(null);
  4.         var ns =  new NetStream(nc);
  5.         videoBox.video.attachVideo(ns);
  6.         //ns.play("movie.flv");
  7. var  myBitmapData = new BitmapData(videoBox._width, videoBox._height, true,  0xff0000);
  8.         reflectBox.attachBitmap(myBitmapData,  1);
  9.         reflectBox._yscale  = -100;
  10.         reflectBox._y  = videoBox._y + videoBox._height*2;
  11.     gradianBox._x  = ref._x;
  12. reflectBox.cacheAsBitmap  = true;
  13.         gradianBox.cacheAsBitmap  = true;
  14.         reflectBox.setMask(gradianBox);
  15. this.onEnterFrame  = function (){
  16.         myBitmapData.draw(videoBox);
  17.         };
  18. PlayButton.onRelease  = function(){
  19.         this._visible = false;
  20.         ns.play("movie.flv");
  21.         }

Download Source File :  reflet video source (132)





© 2013 mutationevent. All Rights Reserved.

REJOINEZ NOTRE MAILING LIST
Get awesome projects delivered to your inbox each week.

Connect with us