maisonRouge.addEventListener(MouseEvent.MOUSE_OVER, start_big);
maisonRouge.addEventListener(MouseEvent.MOUSE_OUT, end_big);
maisonRouge.addEventListener(Event.ENTER_FRAME, agrandir);
maisonVerte.addEventListener(MouseEvent.MOUSE_OVER, start_big2);
maisonVerte.addEventListener(MouseEvent.MOUSE_OUT, end_big2);
maisonVerte.addEventListener(Event.ENTER_FRAME, agrandir2);
var start:Boolean=false;
//début maisonRouge
function start_big(evt:MouseEvent) {
start=true;
}
function end_big(evt:MouseEvent) {
start=false;
}
function agrandir(event:Event) {
if (start) {
if (event.currentTarget.scaleX<1) {
var h0=event.currentTarget.height;
event.currentTarget.scaleX*=1.1;
event.currentTarget.scaleY*=1.1;
var h1=event.currentTarget.height;
event.currentTarget.y-=(h1-h0)/2;
}
} else {
if (event.currentTarget.scaleX>0.6) {
var hh0=event.currentTarget.height;
event.currentTarget.scaleX/=1.1;
event.currentTarget.scaleY/=1.1;
var hh1=event.currentTarget.height;
event.currentTarget.y-=(hh1-hh0)/2;
}
}
}
//début maisonVerte
function start_big2(evt:MouseEvent) {
start=true;
}
function end_big2(evt:MouseEvent) {
start=false;
}
function agrandir2(event:Event) {
if (start) {
if (event.currentTarget.scaleX<1.5) {
var h0=event.currentTarget.height;
event.currentTarget.scaleX*=1.1;
event.currentTarget.scaleY*=1.1;
var h1=event.currentTarget.height;
event.currentTarget.y-=(h1-h0)/2;
}
} else {
if (event.currentTarget.scaleX>1) {
var hh0=event.currentTarget.height;
event.currentTarget.scaleX/=1.1;
event.currentTarget.scaleY/=1.1;
var hh1=event.currentTarget.height;
event.currentTarget.y-=(hh1-hh0)/2;
}
}
}