// Andreas Weber, webweber@motiondraw.com class com.motiondraw.GradientTween{ public var width:Number; public var height:Number; public var multiGradient:Array; private var r:Array; private var r1c:Array; private var c1c:Array; private var a1c:Array; private var r2c:Array; private var c2c:Array; private var a2c:Array; private var rLen:Number; private var rotation1:Number; private var rotation2:Number; private var draw:Boolean; private var rT:Array; function GradientTween( colors1:Array, alphas1:Array, ratios1:Array, rotation1:Number, colors2:Array, alphas2:Array, ratios2:Array, rotation2:Number, gradModeRotation:String, width:Number, height:Number, canvas:MovieClip, draw:Boolean){ var aC,alphas,c,cC,colors,endC,eI,eV,hex,i,j,k,len,matrix,rC,rotation,sI,searchV,startC,sV,t; if(draw == undefined){ draw = true; } this.width = width; this.height = height; this.rotation1 = rotation1; this.rotation2 = rotation2; r = ratios1.concat(ratios2); r.sort(16); multiGradient = new Array(); for(i=1, len=r.length; i> 16, g:(hex & 0x00FF00) >> 8, b:hex & 0x0000FF} } for(var i=0, len=c2c.length; i> 16, g:(hex & 0x00FF00) >> 8, b:hex & 0x0000FF} } for(var k=0; k<2; k++){ aC = k ? a1c : a2c; rC = k ? r1c : r2c; cC = k ? c1c : c2c; // Find the new ratios and push in a flag for the new colors for(var i=0; i width || p.x < 0 || p.y > height || p.y < 0){ return -1; } var eC,endC, i,sC,startC, xInd,xT,yT,yInd; xT = p.x/width; yT = p.y/height; if(!rT){ rT = new Array(); for(i=1; i