Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionimport mx.utils.Delegate; var numOfItems:Number; var radiusX:Number = 180; var radiusY:Number = 75; var centerX:Number = 900; var centerY:Number = 150; var speed:Number = 0.05; var perspective:Number = 1; var home:MovieClip = this; var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000); 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.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 = define; t.image = nodes[i].attributes.image; } } 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 define(){ if (this._parent.image == "carroussel/disque.png"){ t.icon.onRelease = btn_jukebox; }else if (this._parent.image == "carroussel/animation.png"){ t.icon.onRelease = btn_animation; }else if (this._parent.image == "carroussel/graphisme.png"){ t.icon.onRelease = btn_graphisme; }else if (this._parent.image == "carroussel/mail.png"){ t.icon.onRelease = btn_contact; }else if (this._parent.image == "carroussel/cadenas.png"){ t.icon.onRelease = btn_projet; }else if (this._parent.image == "carroussel/tarif.png"){ t.icon.onRelease = btn_tarifs; } } btn_jukebox.onRelease = function(){ var sou:Sound = new Sound(); sou.attachSound("click"); sou.start(); removeMovieClip("projet"); removeMovieClip("animation"); removeMovieClip("contact"); removeMovieClip("graphisme"); removeMovieClip("tarifs"); btn_jukebox.enabled = false; var clip:MovieClip = this._root.attachMovie("IDjukebox","jukebox",getNextHighestDepth()+1,{_x:600,_y:440}); clip.close_jukebox.onPress = function(){ this._parent.removeMovieClip(); btn_jukebox.enabled = true; } } btn_animation.onRelease = function(){ var sou:Sound = new Sound(); sou.attachSound("click"); sou.start(); removeMovieClip("projet"); removeMovieClip("contact"); removeMovieClip("tarifs"); removeMovieClip("graphisme"); removeMovieClip("jukebox"); btn_animation.enabled = false; var clip:MovieClip = this._root.attachMovie("IDanimation","animation",getNextHighestDepth()+1,{_x:600,_y:440}); clip.close_animation.onPress = function(){ this._parent.removeMovieClip(); btn_animation.enabled = true; } } btn_graphisme.onRelease = function(){ var sou:Sound = new Sound(); sou.attachSound("click"); sou.start(); removeMovieClip("projet"); removeMovieClip("jukebox"); removeMovieClip("contact"); removeMovieClip("tarifs"); removeMovieClip("animation"); btn_graphisme.enabled = false; var clip:MovieClip = this._root.attachMovie("IDgraphisme","graphisme",getNextHighestDepth()+1,{_x:600,_y:440}); clip.close_graphisme.onPress = function(){ this._parent.removeMovieClip(); btn_graphisme.enabled = true; } } btn_contact.onRelease = function(){ var sou:Sound = new Sound(); sou.attachSound("click"); sou.start(); removeMovieClip("graphisme"); removeMovieClip("jukebox"); removeMovieClip("animation"); removeMovieClip("projet"); removeMovieClip("tarifs"); btn_contact.enabled = false; var clip:MovieClip = this._root.attachMovie("IDcontact","contact",getNextHighestDepth()+1,{_x:600,_y:440}); clip.close_contact.onPress = function(){ this._parent.removeMovieClip(); btn_contact.enabled = true; } } btn_projet.onRelease = function(){ var sou:Sound = new Sound(); sou.attachSound("click"); sou.start(); removeMovieClip("animation"); removeMovieClip("jukebox"); removeMovieClip("contact"); removeMovieClip("graphisme"); removeMovieClip("tarifs"); btn_projet.enabled = false; var clip:MovieClip = this._root.attachMovie("IDprojet","projet",getNextHighestDepth()+1,{_x:600,_y:440}); clip.close_projet.onPress = function(){ this._parent.removeMovieClip(); btn_projet.enabled = true; } } btn_tarifs.onRelease = function(){ var sou:Sound = new Sound(); sou.attachSound("click"); sou.start(); removeMovieClip("projet"); removeMovieClip("contact"); removeMovieClip("animation"); removeMovieClip("jukebox"); removeMovieClip("graphisme"); btn_tarifs.enabled = false; var clip:MovieClip = this._root.attachMovie("IDtarifs","tarifs",getNextHighestDepth()+1,{_x:600,_y:440}); clip.close_tarifs.onPress = function(){ this._parent.removeMovieClip(); btn_tarifs.enabled = true; } } 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)/10000; }
var clipload:Array = new Array(); function released() { trace(this._parent.image); var sou:Sound = new Sound(); sou.attachSound("click"); sou.start(); if (this._parent.image == "carroussel/disque.png"){ clipload.push ("jukebox"); trace(clipload); removeMovieClip("projet"); removeMovieClip("animation"); removeMovieClip("contact"); removeMovieClip("graphisme"); removeMovieClip("tarifs"); var clip:MovieClip = this._root.attachMovie("IDjukebox","jukebox",getNextHighestDepth()+1,{_x:600,_y:440}); clip.close_jukebox.onPress = function() { this._parent.removeMovieClip(); clipload.shift(); } }else if (this._parent.image == "carroussel/disque.png" && clipload.toString("jukebox")){ clipload.shift(); }