Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Modificare script Sephiroth Slide con XML

    Ciao ragazzi ho scaricato questo slide dal sito di sephiroth
    vorrei modificarlo in modo da aggiungere sei pulsanti di stop/play/avanti/indietro adesso come adesso scorrono da sole.

    Questo è il codice contenuto in flash:

    codice:
    #initclip 1
    ImageFader = function () {
    	this.__init__ ();
    };
    ImageFader.prototype = new MovieClip ();
    // ** init class ** //
    ImageFader.prototype.__init__ = function () {
    	this._xscale = 100
    	this._yscale = 100
    	this.bounding_box.unloadMovie()	
    	this._fader_.unloadMovie()
    	this._dataProvider = new Array ();
    	this._count = 0;
    	this._depth = 1;
    	this._isLoaded = -1;
    	if (this._S_) {
    		clearInterval (this._S_);
    	}
    	if (this._xmlfile != "") {
    		this.loadXML (this._xmlfile);
    	}
    };
    // *** load the external xml ** //
    ImageFader.prototype.loadXML = function (x) {
    	var _xml = new XML ();
    	_xml.ignoreWhite = true;
    	_xml.path = this;
    	_xml.load (x);
    	_xml.onLoad = function () {
    		for (var a = 0; a < this.firstChild.childNodes.length; a++) {
    			var _trans = this.firstChild.childNodes[a].attributes.TRANSITION;
    			var _pause = this.firstChild.attributes.PAUSE
    			var _img = this.firstChild.childNodes[a].firstChild.nodeValue;
    			this.path._dataProvider.push ({img:_img, transition:_trans, pause:_pause});
    		}
    		this.path.startFading ();
    		delete this;
    	};
    };
    // ** start fading procedure ** //
    ImageFader.prototype.startFading = function () {
    	if (this._dataProvider.length > 0) {
    		this.makeFader(true)
    	}
    };
    // ** load images ** //
    ImageFader.prototype.makeFader = function (first) {
    	this._isLoaded = -1;
    	this._tmp = this.attachMovie ("ImageLoader", "ImageLoader" + this._depth, this._depth++);
    	this._old1 = this['ImageLoader' + (this._depth - 1)]
    	this._old2 = this['ImageLoader' + (this._depth - 2)]
    	this._tmp.loadHandler ("isLoaded", this._count);
    	this._tmp.autoStart = false;
    	this._tmp.transition = this._dataProvider[this._count].transition
    	this._tmp.loadImage (this._dataProvider[this._count].img);
    	this._t1 = getTimer()
    	this.onEnterFrame = function(){
    		this._t2 = getTimer()
    		if((this._t2 - this._t1) > this._dataProvider[this._count].pause || first==true){
    			if(this._isLoaded == this._count || this._isLoaded == 1 && this._count == 0){
    				delete this.onEnterFrame;
    				this._tmp.start()
    				this._old1.fadeOut()
    				this._old2.removeMovieClip()
    				if(this._count + 1 < this._dataProvider.length){
    					this._count++
    					this.makeFader()
    					return;
    				} else {
    					if(this._loop == true){
    						this._count = 0
    						this.makeFader()
    					}
    				}
    			}
    		}
    	}
    };
    // ** which has been loaded ? ** //
    ImageFader.prototype.isLoaded = function (num) {
    	this._isLoaded = num;
    };
    Object.registerClass ("ImageFader", ImageFader);
    #endinitclip
    AweDesign "power & Creation"
    Tecnical supp:info@awedesign.net
    sito:http://www.awedesign.net

  2. #2
    codice:
    #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;
    			}
    		}
    		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._yscale += 100/this.steps
    				}
    			}				
    			delete this.onEnterFrame;
    		}
    	}
    }
    // transition 8
    ImageLoader.prototype.transition8 = function(){
    	var w = this.clip._width
    	var h = this.clip._height
    	var tot = 32
    	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)
    		var s = random(2)
    		if(s==0){
    			m._y = -h
    			m._rand = random(30) + 15
    			m
    		} else {
    			m._y = h
    			m._rand = -(random(30) + 15)
    		}
    		with(m){
    			beginFill(0x00,100)
    			lineTo((w/tot)+1,0)
    			lineTo((w/tot)+1,h)
    			lineTo(0,h)
    			endFill()
    		}
    		m.onEnterFrame = function(){
    			if(this._rand > 0){
    				if(this._y  + this._rand >= 0){
    					this._y = 0
    					delete this.onEnterFrame
    					return
    				}
    			} else {
    				if(this._y  + this._rand <= 0){
    					this._y = 0
    					delete this.onEnterFrame
    					return
    				}				
    			}
    			this._y += this._rand
    		}
    	}
    	this.clip._alpha = 100
    	this.clip.setMask( this.mask )
    }
    // --------------
    // transition 9
    // --------------
    ImageLoader.prototype.transition9 = function(){
    	var w = this.clip._width
    	var h = this.clip._height
    	var row = 6
    	var col = 6
    	var _k  = 0
    	var _kk = 0
    	var steps = 15
    	this.createEmptyMovieClip('mask',2)
    	var use = random(2) == 0 ? '_xscale' : '_yscale'
    	for(var a = 0; a < row; a++){
    		for(var b = 0; b < col; b++){
    			_k++
    			var m = this.mask.createEmptyMovieClip('m' + _k, 100 + (_k))
    			m._x = b*(w/col)
    			m._y = _kk*(h/row)
    			m[use] = 0
    			m._count = 0
    			m._steps = steps
    			m._t1 = getTimer()
    			m._canStart = a%2==0? (b%2==0 ? 0 : 1) : (b%2==0 ? 1 : 0)
    			with(m){
    				beginFill(0x00,100)
    				lineTo((w/row)+1,0)
    				lineTo((w/row)+1,(h/col)+1)
    				lineTo(0,(h/col)+1)
    				endFill()
    			}
    			m.onEnterFrame = function(){
    				if(this._canStart == true || this._parent._canStart == true){
    					if(this._count >= this._steps){
    						delete this.onEnterFrame;
    						this._parent._canStart = true
    						return
    					}
    					this[use] += 100/this._steps
    					this._count++
    				}
    			}			
    		}
    		_kk++
    	}
    	this.clip._alpha = 100
    	this.clip.setMask( this.mask )
    }
    AweDesign "power & Creation"
    Tecnical supp:info@awedesign.net
    sito:http://www.awedesign.net

  3. #3
    codice:
    // --------------
    // transition 10
    // --------------
    ImageLoader.prototype.transition10 = function(){
    	var w = this.clip._width
    	var h = this.clip._height
    	var num = 10
    	var diff = 5
    	var alpha_diff = 100/num
    	var clip = this.clip
    	for(var a = 0; a < num; a++){		
    		if(a > 0){			
    			var clip = this.createEmptyMovieClip('clip' + a, -(100 + a))
    			clip._alpha = 0
    			clip.loadMovie(this.clip._url)
    		}
    		clip._x = (-w) + (a*(diff++))
    		var mask = this.createEmptyMovieClip('mask'+a,(100+a))
    		mask._visible = 0
    		with(mask){
    			beginFill(0x00,100)
    			lineTo(w,0)
    			lineTo(w,h)
    			lineTo(0,h)
    			endFill()
    		}		
    	}
    	this.onEnterFrame = function(){
    		_loaded = true			
    		for(var a = 1; a < num; 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 < num; a++){
    				this['clip' + a]._alpha = 100 - (a*alpha_diff)
    				this.clip._alpha = 100
    				if(a==0){
    					var clip = this.clip
    				} else {
    					var clip = this['clip'+a]
    				}
    				clip.count = 0
    				clip.steps = steps
    				clip.x_init = clip._x
    				clip.setMask( this['mask'+a] )
    				this['mask' + a]._visible = 1
    				clip.onEnterFrame = function(){
    					if(this._x + 10 >= 0){
    						this._x = 0
    						delete this.onEnterFrame;
    						return
    					}
    					this._x += 10
    				}
    			}
    			delete this.onEnterFrame
    		}
    	}
    }
    // --------------
    // transition 11
    // --------------
    ImageLoader.prototype.transition11 = function(){
    	var w = this.clip._width
    	var h = this.clip._height
    	var num = 9
    	var diff = 10
    	var alpha_diff = 100/num
    	var clip = this.clip
    	var steps = 45
    	for(var a = 0; a < num; a++){		
    		if(a > 0){			
    			var clip = this.createEmptyMovieClip('clip' + a, -(100 + a))
    			clip._alpha = 0
    			clip.loadMovie(this.clip._url)
    		}
    		var mask = this.createEmptyMovieClip('mask'+a,(100+a))
    		mask._visible = 0
     		mask._x = -(w + (a*diff++))
    		mask._alpha = 40
    		mask.steps = steps + num
    		mask._k = 0
    		mask._move = w/steps
    		with(mask){
    			beginFill(0x00,100)
    			lineTo(w,0)
    			lineTo(w,h)
    			lineTo(0,h)
    			endFill()
    		}		
    	}
    	this.onEnterFrame = function(){
    		_loaded = true			
    		for(var a = 1; a < num; 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 < num; a++){				
    				if(a==0){
    					var clip = this.clip
    				} else {
    					var clip = this['clip'+a]
    				}
    				clip._alpha = (100/(num+1))*(a+1)
    				clip.setMask( this['mask'+a] )				
    				this['mask' + a]._visible = 1
    				this['mask' + a].onEnterFrame = function(){
    					if(this._x >= 0){
    						this._x = 0
    						this.unloadMovie()
    						delete this.onEnterFrame;
    						return;
    					}
    					this._x += this._move
    					this._k++
    				}
    			}
    			this['clip'+(a-1)]._alpha = 100
    			delete this.onEnterFrame
    		}
    	}
    }
    
    Object.registerClass ("ImageLoader", ImageLoader);
    #endinitclip
    Questo è il file XML :
    codice:
    <?xml version="1.0"?>
    <!-- 
    set transition number from 1 to 9
    set transition number to 0 for random effect
     -->
    <RSS PAUSE="4000">
    	<IMAGE TRANSITION="11">IM000241.jpg</IMAGE>
    	<IMAGE TRANSITION="11">IM000282.jpg</IMAGE>
    </RSS>
    Ecco sapete mica come posso fare ?
    (esiste un altro file del genere che ha anche questa opzione ?)

    Ultima domanda è possibile tramite ASP leggere il contenuto di una cartella (che contiene le JPG) e stampare un file XML tipo quello sopra ? (le foto sono + di 200 e difficilmente gestibili manualmente)

    Vi prego aiutatemi (mi serve per un cd di un matrimonio )
    Andrea
    AweDesign "power & Creation"
    Tecnical supp:info@awedesign.net
    sito:http://www.awedesign.net

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.