Buonasera a tutti
ho un filmato che carica delle jpg esterne.
il problema č che facendole scalare la transizione non č perfetta.
qialcuno mi sā dire come risolvere la situazione.
grazie
Buonasera a tutti
ho un filmato che carica delle jpg esterne.
il problema č che facendole scalare la transizione non č perfetta.
qialcuno mi sā dire come risolvere la situazione.
grazie
posto il codice
Stage.align = "TL";
Stage.scaleMode = "noscale";
_quality = "BEST";
//caratteri accentati
System.useCodepage = true;
#include "mc_tween2.as"
//
//PRELOAD******************************************* ***************************
//faccio sparire il preloading
_root.preload.alphaTo(0,0.2,"easeout");
//funzione per far sparire il preload delle imamgini
function killpreload() {
_root.imgpreload.unloadMovie();
}
//preload immagini
_root.imgpreload.tween(['_alpha'],[0],0,'easeoutQuad');
_root.imgpreload.tween(['_alpha'],[100],0.4,'easeoutQuad');
//FINE PRELOAD******************************************* ***************************
//
//NUMERO PULSANTI DA XML
//
var np = xmlmenu.firstChild.childNodes[1].childNodes.length;//NUMERO DI PULSANTI
trace("NUMERO PULSANTI="+_root.np);
//
//PAGINA CORRENTE
//
if (_root.pgn == "" || _root.pgn == undefined) {
var pgn =0;
}
_root.paginacorrente = _root.pgn;
//
//CICLO DI DEFINIZIONE VARIABILI
//
for (var i:Number = 0; i<_root.np; i++) {
_root['titolo'+i] = xmlmenu.firstChild.childNodes[1].childNodes[i].childNodes[0].firstChild.nodeValue;//titolo pulsante
_root['link'+i] = xmlmenu.firstChild.childNodes[1].childNodes[i].childNodes[1].firstChild.nodeValue;//link pulsante
_root['target'+i] = xmlmenu.firstChild.childNodes[1].childNodes[i].childNodes[2].firstChild.nodeValue;//target pulsante
_root['nimg'+i] = xmlmenu.firstChild.childNodes[1].childNodes[i].childNodes[3].childNodes.length;//numero di imamgini associate
//TRACE
trace("VOCE: "+i);
trace("TITOLO: "+_root['titolo'+i]);
trace("LINK: "+_root['link'+i]);
trace("TARGET: "+_root['target'+i]);
trace("NUMERO IMMAGINI DI QUESTA PAGINA: "+_root['nimg'+i]);
//
//ciclo le immagini e le salvo nelle rispettive variabili
for (var t:Number = 0; t<_root['nimg'+i]; t++) {
_root['img_'+i+'_'+t] = xmlmenu.firstChild.childNodes[1].childNodes[i].childNodes[3].childNodes[t].firstChild.nodeValue;
trace("------->IMMAGINE "+t+": "+_root['img_'+i+'_'+t]);
}
}
//INFORMAZIONI RELATIVE A QUESTA SPECIFICA PAGINA
//
//IMMAGINI TOP*********************************************** **************************************************
//
//QUESTO MODULO NON SERVE NEL CASO NON CI SIANO IMMAGINI ASSOCIATE DINAMICAMENTE (VIA XML) AL FILMATO
//
//carico le immagini relative a questa pagina
//
import flash.display.BitmapData;
//array contenente le imamgini
var imgPath = new Array();
for (var i:Number = 0; i<_root['nimg'+_root.paginacorrente]; i++) {
imgPath[i] = _root['img_'+_root.paginacorrente+'_'+i];
}
var count:Number = 0;
var bmp:Array = new Array();
trace("imgPath="+imgPath);
//
function loadImage():Void {
_root.createEmptyMovieClip("temp",_root.getNextHig hestDepth());
var mcl = new MovieClipLoader();
var myListener = new Object();
myListener.onLoadInit = function(target_mc) {
var bData:BitmapData = new BitmapData(target_mc._width, target_mc._height);
bData.draw(target_mc);
bmp.push(bData);
target_mc.removeMovieClip();
if (_root.count<_root.imgPath.length-1) {
_root.count++;
_root.loadImage();
} else {
showImages();
trace("IMMAGINI CARICATE!!!!");
fimg();//parte la funzione immagini
setInterval(fimg,4000);//intervallo della funzione immagini
//faccio sparire il preload delle imamgini e lo elimino al suo alphazero tramite funzione
_root.imgpreload.tween(['_alpha'],[0],1,'easeoutQuad',0,killpreload);
}
};
mcl.addListener(myListener);
mcl.loadClip(imgPath[count],temp);
}
loadImage();
//
//IMMAGINI SENZA MASCHERA
//
function showImages():Void {
for (var i = 0; i<bmp.length; i++) {
_root.img.createEmptyMovieClip("img"+i,_root.img.g etNextHighestDepth());
immago = eval(_root.img["img"+i]);
immago._x = 0;
immago._y = 0;
immago.attachBitmap(bmp[i],1);
immago._alpha = 0;
}
}
//
//
var contatore:Number = 0;
//alpha 0 a tutte le immagini
for (var i:Number = 0; i<_root['nimg'+_root.paginacorrente]; i++) {
_root.img['img'+i].tween('_alpha',0,0);
_root.img['img'+i].tween('_xscale',100,0);
_root.img['img'+i].tween('_yscale',100,0);
}
//funzione immagini
function fimg() {
trace("CONTATORE-->"+_root.contatore);
_root.img['img'+int(_root.contatore)].tween('_alpha',100,2,'easeoutquad');
_root.img['img'+int(_root.contatore)].tween('_xscale',110,5,'easeoutquad');
_root.img['img'+int(_root.contatore)].tween('_yscale',110,5,'easeoutquad');
if (_root.contatore == _root['nimg'+_root.paginacorrente]) {
for (var i:Number = 1; i<(_root['nimg'+_root.paginacorrente]-1); i++) {
_root.img['img'+i].tween('_alpha',0,0);
_root.img['img'+i].tween('_xscale',100,0);
_root.img['img'+i].tween('_yscale',100,0);
}
_root.img.img0.tween('_alpha',100,0);
_root.img.img0.tween('_xscale',100,0);
_root.img.img0.tween('_yscale',100,0);
_root.img['img'+(_root['nimg'+_root.paginacorrente]-1)].tween('_alpha',0,2,'easeoutquad');
_root.img['img'+(_root['nimg'+_root.paginacorrente]-1)].tween('_xscale',100,2,'easeoutquad');
_root.img['img'+(_root['nimg'+_root.paginacorrente]-1)].tween('_yscale',100,2,'easeoutquad');
_root.contatore = 0;
} else {
_root.contatore++;
}
}