home *** CD-ROM | disk | FTP | other *** search
- function setQuitter(s)
- {
- if(s !== "quitgmf")
- {
- btnquitter.onRelease = function()
- {
- trace("quitter le jeu");
- _root.attachMovie("quitgame","quitgame",200);
- quitgame._visible = true;
- };
- btnquitter.onRollOver = function()
- {
- _level0.showToolTip("Retourner au menu");
- btnquitter._alpha = 100;
- btnquitter.gotoAndPlay("in");
- };
- btnquitter.onRollOut = btnquitter.onDragOut = function()
- {
- _level0.hideToolTip("");
- btnquitter._alpha = 40;
- btnquitter.gotoAndPlay("out");
- };
- }
- else
- {
- btnquitter.onRelease = function()
- {
- trace("quitter gmf");
- menu._visible = false;
- clipRes._visible = false;
- appliquit._visible = true;
- };
- btnquitter.onRollOver = function()
- {
- btnquitter.gotoAndPlay("in");
- btnquitter._alpha = 100;
- _level0.showToolTip("Quitter");
- };
- btnquitter.onRollOut = btnquitter.onDragOut = function()
- {
- btnquitter.gotoAndPlay("out");
- btnquitter._alpha = 40;
- _level0.hideToolTip("");
- };
- }
- }
- function retourMenu()
- {
- gotoAndStop("menu");
- _root.mcscene.efface();
- _root.mcscene.resetObjs();
- activeZoom(false);
- menu._visible = true;
- menu.gotoAndPlay("grand");
- quizzz.removeMovieClip();
- }
- function playSound(s, v)
- {
- if(_global.sonActif != false)
- {
- var _loc1_ = new Sound();
- _loc1_.attachSound(s);
- if(v != null)
- {
- _loc1_.setVolume(v);
- }
- _loc1_.start();
- }
- }
- function zoomSouris()
- {
- var _loc1_ = this;
- var _loc2_ = _root;
- if(zoom)
- {
- _loc1_._xscale += (targetscale - _loc1_._xscale) * 0.1;
- _loc1_._yscale = _loc1_._xscale;
- if(enfonce && souris)
- {
- _loc1_._x = mousex - centrex * _loc1_._xscale / 100;
- _loc1_._y = mousey - centrey * _loc1_._xscale / 100;
- }
- if(!enfonce || !souris)
- {
- if(souris)
- {
- if(_loc2_._xmouse < minXmouse)
- {
- targetx += Math.abs(_loc2_._xmouse - minXmouse) * accel;
- }
- if(_loc2_._xmouse > maxXmouse)
- {
- targetx -= Math.abs(_loc2_._xmouse - maxXmouse) * accel;
- }
- if(_loc2_._ymouse < minYmouse)
- {
- targety += Math.abs(_loc2_._ymouse - minYmouse) * accel;
- }
- if(_loc2_._ymouse > maxYmouse)
- {
- targety -= Math.abs(_loc2_._ymouse - maxYmouse) * accel;
- }
- }
- else
- {
- targetx = largeur * 0.5 - ciblex * _loc1_._xscale / 100;
- targety = hauteur * 0.5 - cibley * _loc1_._yscale / 100;
- _loc1_._x += (targetx - _loc1_._x) * 0.5;
- _loc1_._y += (targety - _loc1_._y) * 0.5;
- if(Math.abs(targetscale - _loc1_._xscale) < 5)
- {
- _loc1_.callback();
- _loc1_.callback = null;
- }
- }
- if(targetx + _loc1_.getBounds(_loc1_).xMin * _loc1_._xscale / 100 > 0)
- {
- targetx = (- _loc1_.getBounds(_loc1_).xMin) * _loc1_._xscale / 100;
- }
- else if(targetx + _loc1_.getBounds(_loc1_).xMax * _loc1_._xscale / 100 < largeur)
- {
- targetx = largeur - _loc1_.getBounds(_loc1_).xMax * _loc1_._xscale / 100;
- }
- if(targety + _loc1_.getBounds(_loc1_).yMin * _loc1_._xscale / 100 > 0)
- {
- targety = (- _loc1_.getBounds(_loc1_).yMin) * _loc1_._xscale / 100;
- }
- else if(targety + _loc1_.getBounds(_loc1_).yMax * _loc1_._xscale / 100 < hauteur)
- {
- targety = hauteur - _loc1_.getBounds(_loc1_).yMax * _loc1_._xscale / 100;
- }
- _loc1_._x += (targetx - _loc1_._x) * 0.1;
- _loc1_._y += (targety - _loc1_._y) * 0.1;
- }
- if(_loc1_._x + _loc1_.getBounds(_loc1_).xMin * _loc1_._xscale / 100 > 0)
- {
- _loc1_._x = (- _loc1_.getBounds(_loc1_).xMin) * _loc1_._xscale / 100;
- }
- else if(_loc1_._x + _loc1_.getBounds(_loc1_).xMax * _loc1_._xscale / 100 < largeur)
- {
- _loc1_._x = largeur - _loc1_.getBounds(_loc1_).xMax * _loc1_._xscale / 100;
- }
- if(_loc1_._y + _loc1_.getBounds(_loc1_).yMin * _loc1_._xscale / 100 > 0)
- {
- _loc1_._y = (- _loc1_.getBounds(_loc1_).yMin) * _loc1_._xscale / 100;
- }
- else if(_loc1_._y + _loc1_.getBounds(_loc1_).yMax * _loc1_._xscale / 100 < hauteur)
- {
- _loc1_._y = hauteur - _loc1_.getBounds(_loc1_).yMax * _loc1_._xscale / 100;
- }
- }
- }
- function zoomTo(x, y, z, f)
- {
- playSound("sonzoom",20);
- zoom = true;
- targetscale = z;
- souris = false;
- mcscene.callback = f;
- ciblex = x;
- cibley = y;
- }
- function pageRes()
- {
- menu._visible = false;
- clipRes._visible = true;
- }
- stop();
- souris = true;
- zoom = false;
- accel = 0.08;
- safezoneX = 80;
- safezoneY = 80;
- largeur = 550;
- hauteur = 300;
- btnquitter.gotoAndStop(1);
- btnquitter._alpha = 40;
- targetx = mcscene._x;
- targety = mcscene._y;
- minXmouse = (Stage.width - safezoneX) / 2;
- maxXmouse = (Stage.width + safezoneX) / 2;
- minYmouse = (Stage.height - safezoneY) / 2;
- maxYmouse = (Stage.height + safezoneY) / 2;
- targetscale = 100;
- mouseEcouteur = {};
- enfonce = false;
- mouseEcouteur.onMouseUp = function()
- {
- playSound("sonzoom",20);
- centrex = mcscene._xmouse;
- centrey = mcscene._ymouse;
- mousex = _root._xmouse;
- mousey = _root._ymouse;
- targetscale = 100;
- enfonce = false;
- };
- mouseEcouteur.onMouseDown = function()
- {
- enfonce = true;
- playSound("sonzoom",20);
- centrex = mcscene._xmouse;
- centrey = mcscene._ymouse;
- mousex = _root._xmouse;
- mousey = _root._ymouse;
- targetscale = 400;
- };
- _global.activeZoom = function(bool)
- {
- if(bool)
- {
- Mouse.addListener(mouseEcouteur);
- zoom = true;
- souris = true;
- }
- else
- {
- Mouse.removeListener(mouseEcouteur);
- zoom = false;
- souris = false;
- }
- };
- mcscene.onEnterFrame = zoomSouris;
-