Salve a tutti.
Io ho scarikato un tutorial ke vorrei modificare eliminando un paio di effetti. leggendo lo script non riesko a capire kosa dovrei eliminare. qualk1 può aiutarmi? Voglio eliminare l'effetto slide sfumato e i cerki ke maskerano la foto ke viene caircata. lo script è molto komplesso ed è il seguente ke divido i 2 parti:
#initclip 0
// ------------------
// DRAW CIRCLE
// ------------------
MovieClip.prototype.drawCircle = function(thex, they,theradius, lineW, lineColor, fillColor, fillAlpha)
{
var x, y, r, u, v;
x = thex;
y = they;
r = theradius;
u = r*0.4086;
v = r*0.7071;
if(lineW != '')
{
this.lineStyle(lineW, lineColor, 100);
}
if(fillColor != undefined || fillColor != '')
{
this.beginFill(fillColor, fillAlpha);
}
this.moveTo(x-r, y);
this.curveTo(x-r, y-u, x-v, y-v);
this.curveTo(x-u, y-r, x, y-r);
this.curveTo(x+u, y-r, x+v, y-v);
this.curveTo(x+r, y-u, x+r, y);
this.curveTo(x+r, y+u, x+v, y+v);
this.curveTo(x+u, y+r, x, y+r);
this.curveTo(x-u, y+r, x-v, y+v);
this.curveTo(x-r, y+u, x-r, y);
if(fillColor != undefined || fillColor != '')
{
this.endFill();
}
};
// -----------------------------
// ease out
// -----------------------------
MovieClip.prototype.easeOut = function(x,y,a,b)
{
var x = arguments[0];
var y = arguments[1];
k = new Object();
this.onEnterFrame = function()
{
this.dx = (this.dx + ((x-this._x))/a)/b
this.dy = (this.dy + ((y-this._y))/a)/b
this._x += this.dx;
this._y += this.dy;
};
};
// hide prototype methods
ASSetPropFlags(MovieClip.prototype, 'drawCircle',0)
ASSetPropFlags(MovieClip.prototype, 'easeOut',0)
// ****************************
// ImageLoader Class
// ****************************
ImageLoader = function () {
this.hasLoaded = false;
this.autoStart = false;
this.transition = 1
};
ImageLoader.prototype = new MovieClip ();
// loadHandler
ImageLoader.prototype.loadHandler = function (callback, c) {
this.callback = callback;
this.callback_num = c;
};
// execute handler once loaded
ImageLoader.prototype.executeHandler = function () {
if (this.hasLoaded == false) {
this._parent[this.callback] (this.callback_num);
this.hasLoaded = true;
}
if (this.autoStart) {
this.executeCallBack ();
}
};
// start transition
ImageLoader.prototype.start = function () {
this.executeCallBack ();
};
// load ext image
ImageLoader.prototype.loadImage = function (img) {
this.img = img;
this.createEmptyMovieClip ("clip", 1);
this.clip._alpha = 0;
this.clip.loadMovie (this.img);
this.preloadImage ();
};
// preload image
ImageLoader.prototype.preloadImage = function () {
this.onEnterFrame = function () {
if (this.clip._url != this._url && this.clip.getBytesLoaded () >= this.clip.getBytesTotal () && this.clip.getBytesTotal () > 4) {
delete this.onEnterFrame;
this.executeHandler ();
}
};
};
// finish loading
ImageLoader.prototype.executeCallBack = function () {
/*
when transition is 0 then make a random
transition effect based on the number of
transition functions
*/
var num_of_transition = 11 // you can add your own transition function
if(this.transition == 0){
this.transition = random(num_of_transition) + 1
//this.transition = 11
}
if(this.transition == 1){
this.onEnterFrame = function () {
if (this.clip._alpha > 100) {
this.clip._alpha = 100;
delete this.onEnterFrame;
}
this.clip._alpha += 5;
};
} else {
this['transition' + this.transition]()
}
};
// finish loading
ImageLoader.prototype.fadeOut = function () {
var a = 0;
while(this['mask'+a] != undefined){
this['mask'+a].unloadMovie()
this['clip'+a].unloadMovie()
a++
}
this.clip._alpha = 100
};
// ******************************* transitions ***************************** //
// transition 2
ImageLoader.prototype.transition2 = function(){
var w = this.clip._width
var h = this.clip._height
var tot = 24
this.createEmptyMovieClip('mask',2)
for(var a = 0; a < tot; a++){
var m = this.mask.createEmptyMovieClip('m' + a, 100 + (a))
m._x = a*(w/tot)
m._xscale = 0
with(m){
beginFill(0x00,100)
lineTo(w/tot,0)
lineTo(w/tot,h)
lineTo(0,h)
endFill()
}
m.onEnterFrame = function(){
if(this._xscale > 100){
this._yscale = 100
delete this.onEnterFrame
}
this._xscale += ((this._name.substr(1)*1)/2) + 4
}
}
this.clip._alpha = 100
this.clip.setMask( this.mask )
}
// transition 3
ImageLoader.prototype.transition3 = function(){
this.c = new Color(this.clip)
this.o = {rb:100,gb:100,bb:100}
this.up = true
this.onEnterFrame = function(){
if(this.clip._alpha < 100){
this.clip._alpha += 10
}
if(this.up == false){
this.o.rb -= 10
this.o.bb -= 10
this.o.gb -= 10
} else {
if(this.o.rb < 255){
this.o.rb *= 1.5
this.o.bb *= 3
this.o.gb *= 1.5
} else {
this.o = {rb:255,gb:255,bb:255}
this.up = false;
}
}
if(this.o.rb < 0){
this.o = {rb:0,gb:0,bb:0}
delete this.onEnterFrame;
}
this.c.setTransform(this.o)
}
}
// transition 4
ImageLoader.prototype.transition4 = function(){
var w = this.clip._width
var h = this.clip._height
this.createEmptyMovieClip('mask', 2)
var row = 4
var col = 4
var tot = row*col
var _k = 1
var y = (h/row)
for(var a = 0; a < tot; a++){
var mask = this.mask.createEmptyMovieClip('mask' + a, 100 + (a))
mask._x = _k*((w/row)) - (w/tot)
mask._y = y
mask._xscale = 0
mask._yscale = 0
mask._visible = 0
mask.drawCircle(-(w/tot)/row,-(w/tot)/row,(w/tot),0,0x00,0x00,100)
if(_k%row==0 && a > 0){
_k = 1
y += h/row - (h/tot)
} else {
_k++
}
mask.onEnterFrame = function(){
if(this._xscale > 700){
this._xscale = 700
this._yscale = 700
delete this.onEnterFrame
}
this._xscale += 20
this._yscale += 20
}
this.clip._alpha = 100
this.clip.setMask(this.mask)
}
}
// transition 5
ImageLoader.prototype.transition5 = function(){
var w = this.clip._width
var h = this.clip._height
var tot = 32
var clip = this.clip
this.createEmptyMovieClip("mask", 2)
for(var a = 0; a < tot; a++){
var m = this.mask.createEmptyMovieClip("m"+a,(a+2))
m._y = a*(h/tot)
m._yscale = 0
with(m){
beginFill(0x00,100)
moveTo(0,0)
lineTo(w,0)
lineTo(w,(h/tot)+1)
lineTo(0,(h/tot)+1)
endFill()
}
m.onEnterFrame = function(){
if(this._yscale > 100){
this._yscale = 100
delete this.onEnterFrame
}
this._yscale += ((this._name.substr(1)*1)/2) + 4
}
}
this.clip._alpha = 100
this.clip.setMask( this.mask)
}
// transition 6
ImageLoader.prototype.transition6 = function(){
var w = this.clip._width
var h = this.clip._height
var tot = 12
var steps = 7
var clip = this.clip
for(var a = 0; a < tot; a++){
var mask = this.createEmptyMovieClip('mask' + a, 100 + (a))
mask._x = (w/tot)*a
mask._xscale = 0
mask._visible = 0
with(mask){
beginFill(0x00,100)
moveTo(0,0)
lineTo((w/tot)+1,0)
lineTo((w/tot)+1,h)
lineTo(0,h)
lineTo(0,0)
endFill()
}
if(a > 0){
var clip = this.createEmptyMovieClip('clip' + a, (a+1))
clip._alpha = 0
clip.loadMovie(this.clip._url)
}
clip._x = (w/tot)
}
this.onEnterFrame = function(){
_loaded = true
for(var a = 1; a < tot; a++){
if (this['clip' + a]._url == this._url || this['clip' + a].getBytesLoaded () < this['clip' + a].getBytesTotal () || this['clip' + a].getBytesTotal () < 4) {
var _loaded = false
return;
}
}
if(_loaded){
for(var a = 0; a < tot; a++){
if(a==0){
this.clip.setMask( this.mask0 )
this.clip._alpha = 100
var clip = this.clip
} else {
this['clip'+a].setMask(this['mask' + a])
var clip = this['clip'+a]
}
this['mask'+a]._visible = 1
this['clip'+a]._alpha = 100
if(a > 0){
this['mask'+a].num = this['clip'+a]
} else {
this['mask'+a].num = this.clip
}
this['mask'+a].steps = steps
this['mask'+a].counter = 0
var _a = 2 + (random(10)/10)
var _b = 1.2 + (random(10)/10)
this['mask'+a].num.easeOut(0,0,_a,_b)
this['mask'+a].onEnterFrame = function(){
if(this.counter >= this.steps){
delete this.onEnterFrame;
return;
}
this.counter++
this._xscale += 100/this.steps
//this.num._x -= (w/tot)/this.steps
}
}
delete this.onEnterFrame;
}
}
}
// transition 7
ImageLoader.prototype.transition7 = function(){
var w = this.clip._width
var h = this.clip._height
var tot = 12
var steps = 6
var clip = this.clip
for(var a = 0; a < tot; a++){
var mask = this.createEmptyMovieClip('mask' + a, 100 + (a))
mask._y = (h/tot)*a
mask._yscale = 0
mask._visible = 0
with(mask){
beginFill(0x00,100)
moveTo(0,0)
lineTo(w,0)
lineTo(w,(h/tot) + 1)
lineTo(0,(h/tot) + 1)
lineTo(0,0)
endFill()
}
if(a > 0){
var clip = this.createEmptyMovieClip('clip' + a, (a+1))
clip._alpha = 0
clip.loadMovie(this.clip._url)
}
clip._y = -(h/tot)
}
this.onEnterFrame = function(){
_loaded = true
for(var a = 1; a < tot; a++){
if (this['clip' + a]._url == this._url || this['clip' + a].getBytesLoaded () < this['clip' + a].getBytesTotal () || this['clip' + a].getBytesTotal () < 4) {
var _loaded = false
return;
}
}