Bonjour,
J'ai trouvé, sur le net, un code d'accordion horizontal
[ Lien ]
Malheureusement, je charge le accordion.swf par le biais de 2 loadMovie, qui a pour conséquence de ne pas fonctionner. Normal puisque il y a des "_root" partout!
J'ai besoin d'un peu d'aide pour adapter le code, j'ai retracer mon chemin qui parcourt mes 2 LoadMovie: _root.cp_princip.cp_fentre.mccible.cp_comple.mc_comple
Peut-on mettre le chemin dans une variable?
J'ai essayer avec "this" mais j'ai peut être foiré.
Toute aide est la bien venue, merci ^^
Code ActionScript :
stop();
speed = 20;
initial_width = 100;
target_width = 800;
sp = rect1._x;
this.createEmptyMovieClip("emptymc", 0);
emptymc.onEnterFrame = function() {
for (i=1; i<=8; i++) {
if (_root.hit.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_root["rect"+i].hitTest(_root._xmouse, _root._ymouse, true)) {
new_x = (_root.sp-(100*(i-1)))-rect1._x;
rect1._x += new_x/speed;
n_width = target_width-_root["rect"+i]._width;
_root["rect"+i]._width += n_width/speed;
} else {
n_width2 = initial_width-_root["rect"+i]._width;
_root["rect"+i]._width += n_width2/speed;
}
} else {
new_x = _root.sp-rect1._x;
rect1._x += new_x/(speed+50);
n_width2 = initial_width-_root["rect"+i]._width;
_root["rect"+i]._width += n_width2/(speed-1);
}
_root["rect"+(i+1)]._x = _root["rect"+i]._x+_root["rect"+i]._width;
_root["movie"+i]._x = _root["rect"+i]._x-1;
}
};