Code :
- import flash.filters.DropShadowFilter;
- var loadListener:Object = new Object();
- //--------------------------------
- import mx.transitions.*;
- import mx.transitions.easing.*;
- var mcl_obj:Object = new Object();
- //--------------------------------
- _global.SW = Stage.width;
- _global.SH = Stage.height;
- _global.SWsur2 = SW/2;
- _global.SHsur2 = SH/2;
- Stage.scaleMode = "exactFit";
- //----------------------------------------------
- rectangle_arrondi_ombre = function (clip, larg, haut, rayon, epais, couleur, transp) {
- var mc = clip.createEmptyMovieClip("rectangle_arrondi", 10000);
- mc.onLoad = function() {
- with (this) {
- moveTo(rayon, 0);
- //-------------------
- lineStyle(epais, 0x999999, 100);
- beginFill(couleur, transp);
- moveTo(rayon, 0);
- lineTo(larg-rayon, 0);
- curveTo(larg, 0, larg, rayon);
- lineTo(larg, haut-rayon);
- curveTo(larg, haut, larg-rayon, haut);
- lineTo(rayon, haut);
- curveTo(0, haut, 0, haut-rayon);
- lineTo(0, rayon);
- curveTo(0, 0, rayon, 0);
- endFill();
- }
- var filter:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, .6, 6, 6, 1, 2, false, false, false);
- var filterArray:Array = new Array();
- filterArray.push(filter);
- this.filters = filterArray;//
- };
- mc.onLoad();
- };
- //----------------------------------------------
- _root.createEmptyMovieClip("cadre", -1111);
- cadre.onLoad = function() {
- this._x = 2;
- this._y = 2;
- rectangle_arrondi_ombre(this, SW-10, SH-10, SW/30,1, 0xC0DFFD,100);
- };
- cadre.onLoad();
- //----------------------------------------------
- chargement_jpg = function (clip, jpg, couleur) {
- clip._alpha = 0;
- var mcLoader:MovieClipLoader = new MovieClipLoader();
- mcLoader.addListener(loadListener);
- mcLoader.loadClip(jpg, clip.dest);
- loadListener.onLoadInit = function(mc_cible:MovieClip):Void {
- var CI_PAR = mc_cible._parent;
- //----------------------------------------------
- mc_cible.proportion = (mc_cible._width/mc_cible._height);
- mc_cible._width = Math.floor(CI_PAR._w0*2);
- mc_cible._height = Math.floor(CI_PAR._h0*2);
- // --------------------
- if (Number(mc_cible.proportion)<1) {
- CI_PAR._h0 = CI_PAR._w0/mc_cible.proportion;
- } else {
- CI_PAR._w0 = CI_PAR._h0*mc_cible.proportion;
- }
- CI_PAR._width = CI_PAR._w0;
- CI_PAR._height = CI_PAR._h0;
- /*
- */
- //----------------------------------------------
- new Tween(CI_PAR, "_alpha", Strong.easeIn, 0, 100, 2, true);
- TransitionManager.start(CI_PAR, {type:Fly, direction:Transition.IN, duration:3, easing:Strong.easeOut, startPoint:random(10)});
- TransitionManager.start(CI_PAR, {type:Rotate, direction:Transition.IN, duration:3, easing:Strong.easeOut, ccw:false, degrees:random(720)});
- TransitionManager.start(CI_PAR, {type:Zoom, direction:Transition.IN, duration:3, easing:Strong.easeOut});
- //----------------------------------------------
- CI_PAR.onPress = cliquer;
- CI_PAR.onRelease = relacher;
- CI_PAR.onReleaseOutside = relacher;
- CI_PAR.swapDepths(this.getNextHighestDepth());
- };
- };
- // -----------------------------------------------------
- cliquer = function () {
- var grossissement_V = SH*.94;
- var grossissement_H = grossissement_V*this.dest.proportion;
- if (grossissement_H>SW*.8) {
- delta = grossissement_H/SW*.8;
- grossissement_V *= delta;
- grossissement_H *= delta;
- }
- //---------------------
- delete this.onEnterFrame;
- //---------------------
- this._x0 = _root._xmouse-this._x;
- this._y0 = _root._ymouse-this._y;
- this.swapDepths(_root.niveau += 20);
- this.onEnterFrame = function() {
- this._x = _root._xmouse-this._x0;
- this._y = _root._ymouse-this._y0;
- this._ww = this._width/2;
- this._hh = this._height/2;
- if ((this._x-this._ww)<0) {
- this._x = this._ww;
- }
- if ((this._y-this._hh)<0) {
- this._y = this._hh;
- }
- if ((this._x+this._ww)>SW-10) {
- this._x = SW-this._ww-10;
- }
- if ((this._y+this._hh)>SH-10) {
- this._y = SH-this._hh-10;
- }
- this._rotation += (0-this._rotation)/1.5;
- this._width += (grossissement_H-this._width)/1.2;
- this._height += (grossissement_V-this._height)/1.2;
- };
- };
- relacher = function () {
- delete this.onEnterFrame;
- this._x = (_root._xmouse<50) ? 50 : (_root._xmouse>SW-50) ? SW-50 : _root._xmouse;
- this._y = (_root._ymouse<50) ? 50 : (_root._ymouse>SH-50) ? SH-50 : _root._ymouse;
- this.onEnterFrame = function() {
- this._rotation += (this._r-this._rotation)/2;
- this._width += (this._w0-this._width)/2;
- this._height += (this._h0-this._height)/2;
- if (Math.abs(this._w0-this._width)<10) {
- this._rotation = this._r;
- this._width = this._w0;
- this._height = this._h0;
- delete this.onEnterFrame;
- }
- };
- };
- // -----------------------------------------------------
- allons_y = function (clip, tableau) {
- var L = SW/(tableau.length+2)*2.5;
- var L = SW/7;
- L = Math.floor(L*.9);
- var M = L+5;
- for (var i = 0; i<tableau.length; i++) {
- clip = _root.createEmptyMovieClip("cadre"+i, i);
- clip.onLoad = function() {
- //--------------------
- this._alpha = 30;
- this.lineStyle(4, 0, 20);
- this.moveTo(-(L+2), L);
- //this.lineTo(M, L);
- //this.lineTo(M, -(L - 3));
- // --------------------
- this.moveTo(M, -L);
- this.lineStyle(0, 0xFFFFFF);
- this.beginFill(0xffffff, 100);
- this.lineTo(-M, -L);
- this.lineTo(-M, L);
- this.lineStyle(0, 0x333333);
- this.lineTo(M, L);
- this.lineTo(M, -L);
- this.endFill();
- //--------------------
- this._x0 = (1.2*(i+1))*L;
- this._y0 = L;
- this._x = this._x0;
- this._y = this._y0;
- //--------------------
- this._w0 = L+3;
- this._h0 = L-5+3;
- this._width = this._w0;
- this._height = this._h0;
- //--------------------
- this._x = (SW*.15)+random(SW*.7);
- this._y = (SH*.15)+random(SH*.7);
- this._r = -30+60*Math.random();
- this._rotation = this._r;
- var filter:DropShadowFilter = new DropShadowFilter(8, 45, 0x000000, .5, 6, 6, 1, 3, false, false, false);
- var filterArray:Array = new Array();
- filterArray.push(filter);
- this.filters = filterArray;
- //--------------------
- this.createEmptyMovieClip("dest", i+200);
- //--------------------
- this.dest.onLoad = function() {
- this._x = -L-3;
- this._y = -L+2;
- //var ladress = tableau[i] + "?" + random(99999);
- var ladress = tableau[i];
- chargement_jpg(this._parent, ladress, 0xff8800);
- };
- this.dest.onLoad();
- };
- clip.onLoad();
- }
- };
- //------------------------------------------------------
- niveau = 10000;
- //------------------------------------------------------
- _global.fichier = [];
- System.security.allowDomain("http://s500.free.fr" );
- _global.repertoire = "http://s500.free.fr/pires/villa/";
- //------------------------------------------------------
- for (x=1; x<60; x++) {
- fichier.push("photo_"+x+".jpg" );
- }
- /**/
- for (var i = 0; i<fichier.length; i++) {
- fichier[i] = repertoire+fichier[i];
- //trace(fichier[i]);
- }
- _root.createEmptyMovieClip("phototheque", 0);
- phototheque.onLoad = function() {
- allons_y(this, fichier);
- };
- phototheque.onLoad();
- //------------------------------------------------------
- stop();
- //------------------------------------------------------
|