ciao.
Ho problemi nell'utilizzare lo script (bellissimo peraltro) di Julius "i-tunes gallery" o meglio...
farlo funzionare, ok... adattarlo al mio stage... ok...
la mia prima esigenza (alla quale sono riuscito facilmente a fare fronte) era quella di, mantenendo il bel movimento di distorsione, portare l'immagine in primo piano ad essere grande quanto tutto lo stage.
Però, di conseguenza, avrei bisogno di una thumb gallery che mi porta in primo piano l'immagine cliccata, mantenendo il movimento... spero di essermi spiegato... comunque posto tutto il codice (le modifiche che sono riuscito a fare finora sono anche le uniche cose di cui ho capito qualcosa...)
e ringrazio anticipatamente chiunque mi dia qualche dritta...
codice:
_root.aaa.swapDepths(3002);
_root.info.swapDepths(3000);
import flash.display.*;
import flash.geom.*;
var root:MovieClip = this;
var loadedAll:Boolean;
var distance:Number;
var maxSlide:Number = 100;
var deleteMinDistance:Number = 0;
var deleteMaxDistance:Number = 500;
var doubleClickRegister:Number = 500;
var frontCDWidth:Number = 704;
var frontCDHeight:Number = 382;
var shelveCDHeight:Number = 165;
var shelveCDWidth:Number = 120;
var shelveCDSpacing:Number = 50;
var centerDistance:Number = 200;
var albumEase:Number = 5;
var angle:Number = 8;
var fadePoint:Number = 680;
var fadeDist:Number = 50;
var current:Number = 3;
var centerX:Number = 490;
var centerY:Number = 190;
var clickDelay:Number = 750;
var scrollBarStart:Number = 20;
var scrollerDelay:Number = 150;
var scrollBarStop:Number = scrollBar.scroller._width+31;
var reflectionSpace:Number = 2;
var reflectionAlpha:Number = 50;
var reflectionRotation:Number = 90;
var reflectionFocalPointRatio:Number = 0.3;
var reflectionFillType:String = "linear";
var reflectionSpreadMethod:String = "pad";
var reflectionInterpolationMethod:String = "RGB";
var infostruc:Array = [];
var reflectionColors:Array = [0x000000, 0x000000];
var reflectionAlphas:Array = [100, 0];
var reflectionRatios:Array = [0, 0xFF];
var myMO:Object = {};
var myKO:Object = {};
var xmlData:XML = new XML();
Mouse.addListener(myMO);
Key.addListener(myKO);
MovieClip.prototype.setSides = function(x1:Number, y1:Number, x2:Number, y2:Number, x3:Number, y3:Number, x4:Number, y4:Number):Void {
this.px1 = x1;
this.py1 = y1;
this.px2 = x2;
this.py2 = y2;
this.px3 = x3;
this.py3 = y3;
this.px4 = x4;
this.py4 = y4;
};
MovieClip.prototype.DistortImage = function(ptexture, vseg:Number, hseg:Number) {
if (ptexture instanceof BitmapData) {
this.texture = ptexture;
} else if (ptexture instanceof MovieClip) {
this.texture = new BitmapData(ptexture._width, ptexture._height);
this.texture.draw(ptexture);
}
this._vseg = vseg || 0;
this._hseg = hseg || 0;
this._w = this.texture.width;
this._h = this.texture.height;
this._aMcs = [];
this._p = [];
this._tri = [];
this.init();
};
MovieClip.prototype.setTransform = function(x0:Number, y0:Number, x1:Number, y1:Number, x2:Number, y2:Number, x3:Number, y3:Number):Void {
this.w = this._w;
this.h = this._h;
this.dx30 = x3-x0;
this.dy30 = y3-y0;
this.dx21 = x2-x1;
this.dy21 = y2-y1;
l = this._p.length;
while (--l>-1) {
this.point = this._p[l];
var gx = (this.point.x-this._xMin)/this.w;
var gy = (this.point.y-this._yMin)/this.h;
var bx = x0+gy*(this.dx30);
var by = y0+gy*(this.dy30);
this.point.sx = bx+gx*((x1+gy*(this.dx21))-bx);
this.point.sy = by+gx*((y1+gy*(this.dy21))-by);
}
this.render();
};
MovieClip.prototype.init = function(Void):Void {
this._p = [];
this._tri = [];
this.w2 = this._w/2;
this.h2 = this._h/2;
this._xMin = this._yMin=0;
this._xMax = this._w;
this._yMax = this._h;
this._hsLen = this._w/(this._hseg+1);
this._vsLen = this._h/(this._vseg+1);
for (ix=0; ix<this._hseg+2; ix++) {
for (iy=0; iy<this._vseg+2; iy++) {
x = ix*this._hsLen;
y = iy*this._vsLen;
this._p.push({x:x, y:y, sx:x, sy:y});
}
}
for (ix=0; ix<this._vseg+1; ix++) {
for (iy=0; iy<this._hseg+1; iy++) {
this.p0 = this._p[iy+ix*(this._hseg+2)];
this.p1 = this._p[iy+ix*(this._hseg+2)+1];
this.p2 = this._p[iy+(ix+1)*(this._hseg+2)];
this.addTriangle(this.p0, this.p1, this.p2);
this.p0 = this._p[iy+(ix+1)*(this._vseg+2)+1];
this.p1 = this._p[iy+(ix+1)*(this._vseg+2)];
this.p2 = this._p[iy+ix*(this._vseg+2)+1];
this.addTriangle(this.p0, this.p1, this.p2);
}
}
this.render();
};
MovieClip.prototype.addTriangle = function(p0:Object, p1:Object, p2:Object):Void {
this.tMat = {};
this.u0 = p0.x;
this.v0 = p0.y;
this.u1 = p1.x;
this.v1 = p1.y;
this.u2 = p2.x;
this.v2 = p2.y;
this.tMat.tx = -this.v0*(this._w/(this.v1-this.v0));
this.tMat.ty = -this.u0*(this._h/(this.u2-this.u0));
this.tMat.a = this.tMat.d=0;
this.tMat.b = this._h/(this.u2-this.u0);
this.tMat.c = this._w/(this.v1-this.v0);
this._tri.push([p0, p1, p2, this.tMat]);
};
MovieClip.prototype.render = function(Void):Void {
this.ih = 1/this._h;
this.iw = 1/this._w;
var c:MovieClip = this;
c.clear();
this.sM = {};
this.tM = {};
var l:Number = this._tri.length;
while (--l>-1) {
a = this._tri[l];
this.p0 = a[0];
this.p1 = a[1];
this.p2 = a[2];
this.tM = a[3];
this.sM.a = (this.p1.sx-(this.x0=this.p0.sx))*this.iw;
this.sM.b = (this.p1.sy-(this.y0=this.p0.sy))*this.iw;
this.sM.c = (this.p2.sx-this.x0)*this.ih;
this.sM.d = (this.p2.sy-this.y0)*this.ih;
this.sM.tx = this.x0;
this.sM.ty = this.y0;
this.sM = concat(this.sM, this.tM);
c.beginBitmapFill(this.texture, this.sM, false, false);
c.moveTo(this.x0, this.y0);
c.lineTo(this.p1.sx, this.p1.sy);
c.lineTo(this.p2.sx, this.p2.sy);
c.endFill();
}
};
.. continua