ragazzi ho un array di bitmap che metto dentro un mc per visualizzare le thumb in questo modo
dopo di che quando clicco su una thumb si chiude la maschera e si apre la bitmap grande contenuta nell array in questo modoCodice PHP:private function onImageComplete(evt:Event):void
{
evt.target.removeEventListener(Event.COMPLETE,onImageComplete);
var i:int=int(evt.target.loader.name);
var bitmap:Bitmap=evt.target.loader.content as Bitmap;
arrayLoghiGrandi.push(bitmap);
heightL=bitmap.height;
//a questo punto io già ho la bitmap e le sue dimensioni quindi faccio il controllo per le giuste posizioni
if(counter==0){
posizionaContenitoreLoghi();
}
var bitmap_mc:MovieClip=new MovieClip();
bitmap_mc.mouseEnabled=true;
bitmap_mc.buttonMode=true;
bitmap_mc.name="bitmap_mc"+counter;
bitmap_mc.id=counter;
bitmap_mc.addEventListener(MouseEvent.CLICK,clickItem);
bitmap.smoothing=true;
bitmap_mc.x=bitmap_mc.y=0;
bitmap_mc.addChild(bitmap);
//inserisco gli mc con dimensioni originali per tenerne traccia
bitmap_mc.width=bitmap_mc.width*fattore_di_scala;
bitmap_mc.height=bitmap_mc.height*fattore_di_scala;
bitmap_mc.x=setX;
setX=setX+bitmap_mc.width+2;
maschera_mc=new MovieClip();
//disegno la maschera solo per ora
maschera_mc.graphics.beginFill(0xCCCCCC,0.5);
maschera_mc.graphics.drawRect(0,0,5,bitmap_mc.height);
maschera_mc.x=bitmap_mc.x;
maschera_mc.y=bitmap_mc.y;
//------------------------------------------------------
bitmap_mc.mask =maschera_mc;
Tweener.addTween(maschera_mc,{width:bitmap_mc.width,time:2,transition:"easeOutCubic"});
contenitoreLoghi.addChild(bitmap_mc);
contenitoreLoghi.addChild(maschera_mc);
if(counter<arrayPercorsi.length-1)
{
counter++;
caricaLoghi();
}
else{
trace('all images has been loaded');
eliminaPreload();
ratio=-contenitoreLoghi.width/stage.stageWidth;
addEventListener(Event.ENTER_FRAME,moveHolder);
}
}
tutto funziona solo che scompare la thumb corrispondenteCodice PHP:private function clickItem(evento:MouseEvent):void
{
//elimino l'ascoltatore
evento.target.removeEventListener(MouseEvent.CLICK,clickItem);
trace(evento.target.id);
//creo l'animazione di chiusura delle maschere
//disegno la maschera solo per ora
maschera_mc.graphics.beginFill(0xCCCCCC,0.5);
maschera_mc.graphics.drawRect(0,0,stage.stageWidth,heightL);
maschera_mc.x=0;
maschera_mc.y=contenitoreLoghi.y;
contenitoreLoghi.mask=maschera_mc;
addChild(contenitoreLoghi);
addChild(maschera_mc);
Tweener.addTween(maschera_mc,{width:0,time:2,transition:"easeOutCubic",onComplete:apriLogoGrande});
function apriLogoGrande(){
var m:MovieClip=new MovieClip();
m.addChild(arrayLoghiGrandi[evento.target.id]);
m.x=stage.stageWidth/2-arrayLoghiGrandi[evento.target.id].width/2;
m.y=stage.stageHeight/2-arrayLoghiGrandi[evento.target.id].height/2;
m.alpha=0;
addChild(m);
Tweener.addTween(m,{alpha:1,time:3,transition:"easeOutCubic"});
m.mouseEnabled=true;
m.buttonMode=true;
m.addEventListener(MouseEvent.CLICK,function(){
Tweener.addTween(m,{alpha:1,time:3,transition:"easeOutCubic",onComplete:apriMask});
function apriMask():void{
Tweener.addTween(maschera_mc,{width:stage.stageWidth,time:2,transition:"easeOutCubic"});
removeChild(m);
}
})
}
}
ecco a voi per farvi capire
http://www.graphicsolution.it/nuovo3/loghi/
perchè succede non capisco?

Rispondi quotando