I've been maybe thinking this a bit too much and maybe that's why I'm not able to come up with any kind of solution for my problem. The thing is that I'm working on a website for a client and all the 'portfolio' images should have a diagonal blinds effect (like diagonal lines that expand to reveal the image). I'm using a separate prototype to draw the actual blinds (or blocks) according to 4 xy coordinates passed to the function, but the thing I'm struggling with is that who do I calculate the coordinates..? I'm providing a little piece of code to further express what I mean;

MovieClip.prototype.reveal=function() {
   // the width of each of the blinds
   this.blindSize=32;
   this.currentSize=0;
   this.mask=this.createEmptyMovieClip('mask',this.getNextHighestDepth());
   // total count of blinds required to mask the whole movieclip area
   this.blindCount=Math.round(this._width/this.blindSize);
   this.setMask(this.mask);
   this.$reveal=function() {
      if(this.currentSize>=this.blindSize) {
         clearInterval(this.reveali);
         this.mask.removeMovieClip();
         return;
      }
      this.mask.clear();
      for(i=0;i<this.blindCount;i++) {
         // this is where I need help; how do I figure out the coordinates
         // in which to draw the blind?
         this.mask.drawBlind(x1,y1,x2,y2,x3,y3,x4,y4);
         // drawBlind is just a simple lineTo -> lineTo prototype..
      }
      this.currentSize++;
   };
   this.reveali=setInterval(this,'$reveal',50);
};


It would be no problem of course if the blinds would be drawn horizonally or vertically but maybe I skipped too many math classes in the past since I really can't figure our a method to calculate the coordinates for the blinds that are drawn in 45 degree angle.. If someone can come up with a way easily, I'd appreciate it a lot.

--
jp
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to