Bonjour à tous,
Il y a quelques jours Girou m'avais donné un bon coup de main pour mon animation style "caroussel", l'anim marche très bien. Mais j'ai un problème pour l'insérer dans mon swf principal.
J'ai une anim principale avec 2 clips (le fond et le logo) qui se repositionnent tous deux ds la scène si la fenetre du naviagteur s'agrandit. ca fonctionne très bien. le pb c'est que je n'arrive pas à faire la meme chose en intégrant le caroussel.
le problème étant qu'il se positionne différemment en fonction de la résolution écran, je comprend pas, ca marche très bien pour les 2 autres clips!
Je vous donne le code du caroussel ainsi que celui de mon anim principale... si quelqu'un a une idée..
merci d'avance!

code anim principale:
stop();
Stage.scaleMode = "noScale";
Stage.align = "TL";
import mx.transitions.Tween;
nature._x = Stage.width;
nature._y = Stage.height;
cadrelogo._x = 50;
cadrelogo._y = Stage.height;
menu._x = Stage.width/2;
menu._y = Stage.height;
var ecout:Object = new Object();
ecout.onResize = function() {
bouge();
remplir();
};
Stage.addListener(ecout);
bouge = function () {
var myTween:Tween = new Tween(cadrelogo, "_x", mx.transitions.easing.Elastic.easeOut, cadrelogo._x, 50, 0.1, true);
var myTween2:Tween = new Tween(cadrelogo, "_y", mx.transitions.easing.Elastic.easeOut, cadrelogo._y, Stage.height, 2.2, true);
var myTween3:Tween = new Tween(nature, "_x", mx.transitions.easing.Elastic.easeOut, nature._x, Stage.width, 0.1, true);
var myTween4:Tween = new Tween(nature, "_y", mx.transitions.easing.Elastic.easeOut, nature._y, Stage.height, 1.9, true);
var myTween5:Tween = new Tween(menu, "_x", mx.transitions.easing.Elastic.easeOut, menu._x, Stage.width/2, 0.1, true);
var myTween6:Tween = new Tween(menu, "_y", mx.transitions.easing.Elastic.easeOut, menu._y, Stage.height, 1.9, true);
};
remplir = function () {
this.clear();
this.beginBitmapFill(motif);
this.moveTo(0, 0);
this.lineTo(Stage.width, 0);
this.lineTo(Stage.width, Stage.height);
this.lineTo(0, Stage.height);
this.lineTo(0, 0);
this.endFill();
};
var motif = flash.display.BitmapData.loadBitmap("motif");
remplir();
Code du carousel:
stop();
import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var numOfItems:Number;
var radiusX:Number = 260;
var radiusY:Number = 75;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.05;
var perspective:Number = 130;
var home:MovieClip = this;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10001);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.numIndex=i
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}
function over()
{
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
}
function out()
{
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
}
function released()
{
//c'est ici que je ne sais pas comment formuler (par ex: si j'appuie sur l'icone1 , aller a la frame2)
trace("Icone "+this._parent.numIndex+" à été cliquée")
// ensuite tu fais des comparaisons
if( this._parent.numIndex==0){ _root.gotoAndStop(3)}
if( this._parent.numIndex==1){ gotoAndStop(3)}
if( this._parent.numIndex==5){ gotoAndStop(4)}
// voir aussi l'utilisation de switch case très utile si beaucoup de comparaisons
}
function moveTip()
{
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
}
xml.load("icons.xml");
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}
this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/9000;
}
là, j'ai tout essayé mais là, je ne comprend pas.
