begin process at 2012 05 27 12:09:09
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Flash / Flash MX

 > 

Multimédia

 > 

Effets

 > 

photos qui reste


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

photos qui reste

jeudi 10 janvier 2008 à 21:38:36 | photos qui reste

simple560

jai instalé une galerie photos dans mon site internet et quand je change de page les photos reste.Comment faire popur les faire disparaitre. merci.

le code:

import mx.screens.Slide;
// Import the transitions classes so you can add a fading effect when the images load to the Stage.
import mx.transitions.*;

// Set the starting X and Y positions for the gallery images.
_global.thisX = 480;
_global.thisY = 53;

/* Set static values for the Stage's width and height.
   Using Stage.width and Stage.height within the code results in
   strangely positioned full images when testing in the Flash environment
   (but the problem doesn't exist when published to a SWF file). */
_global.stageWidth = 1;
_global.stageHeight = 1;

// Create and configure the XML instance which is used to load the list of gallery images on the fly.
var gallery_xml:XML = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success:Boolean) {
    try {
        /* if you are able to successfully load and parse the gallery from a remote XML file,
           parse out the image names and add them to an array. */
        if (success) {
            var images:Array = this.firstChild.childNodes;
            var gallery_array:Array = new Array();
            for (var i = 0; i<images.length; i++) {
                gallery_array.push({src:images[i].firstChild.nodeValue});
            }
            /* call the displayGallery function which handles loading in each
               of the gallery images and placing them on the Stage. */
            displayGallery(gallery_array);
        } else {
            throw new Error("Unable to parse XML");
        }
    } catch (e_err:Error) {
        trace(e_err.message);
    } finally {
        delete this;
    }
};

// load the gallery.xml file from the current directory.
gallery_xml.load("gallery_tween1.xml");

/* create a function which loops through the images in an array,
   and creates new movie clips on the Stage. */
function displayGallery(gallery_array:Array) {
    var galleryLength:Number = gallery_array.length;
    // loop through each of the images in the gallery_array.
    for (var i = 0; i<galleryLength; i++) {
        /* create a movie clip instance which holds the image. We'll also set a variable,
           thisMC, which is an alias to the movie clip instance. */
        var thisMC:MovieClip = this.createEmptyMovieClip("image"+i+"_mc", i);
       
        /* load the current image source into the new movie clip instance,
           using the MovieClipLoader class. */
        mcLoader_mcl.loadClip(gallery_array[i].src,thisMC);
       
        // attach the preloader symbol from the Library onto the Stage.
        preloaderMC = this.attachMovie("preloader_mc", "preloader"+i+"_mc", 5000+i);
       
        /* set the preloader's bar_mc's _xscale property to 0%
           and set a default value in the progress bars text field. */
        preloaderMC.bar_mc._xscale = 0;
        preloaderMC.progress_txt.text = "0%";
       
        // set the _x and _y coordinates of the new movie clip.
        thisMC._x = _global.thisX;
        thisMC._y = _global.thisY;
       
        // set the position of the image preloader.
        preloaderMC._x = _global.thisX;
        preloaderMC._y = _global.thisY+20;
       
        // if you've displayed 2 columns of images, start a new row.
        if ((i+1)%2 == 0) {
            // reset the X and Y positions
            _global.thisX = 480;
            _global.thisY += 80;
        } else {
            _global.thisX += 80+20;
        }
    }
}

// define the MovieClipLoader instance and MovieClipLoader listener Object.
var mcLoader_mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadStart = function() {
};

// while the content is preloading, modify the width of the progress bar.
mclListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) {
    var pctLoaded:Number = Math.round(loadedBytes/totalBytes*100);
    // create a shortcut for the path to the preloader movie clip.
    var preloaderMC = target_mc._parent["preloader"+target_mc.getDepth()+"_mc"];
    preloaderMC.bar_mc._xscale = pctLoaded;
    preloaderMC.progress_txt.text = pctLoaded+"%";
};

// when the onLoadInit event is thrown, you're free to position the instances
mclListener.onLoadInit = function(evt:MovieClip) {
    evt._parent["preloader"+evt.getDepth()+"_mc"].removeMovieClip();
    /* set local variables for the target movie clip's width and height,
       and the desired settings for the image stroke and border. */
    var thisWidth:Number = evt._width;
    var thisHeight:Number = evt._height;
    var borderWidth:Number = 2;
    var marginWidth:Number = 2;
    evt.scale = 20;
    // draw a white rectangle with a black stroke around the images.
    evt.lineStyle(borderWidth,0x000000,100);
    evt.beginFill(0xFFFFFF,100);
    evt.moveTo(-borderWidth-marginWidth,-borderWidth-marginWidth);
    evt.lineTo(thisWidth+borderWidth+marginWidth,-borderWidth-marginWidth);
    evt.lineTo(thisWidth+borderWidth+marginWidth,thisHeight+borderWidth+marginWidth);
    evt.lineTo(-borderWidth-marginWidth,thisHeight+borderWidth+marginWidth);
    evt.lineTo(-borderWidth-marginWidth,-borderWidth-marginWidth);
    evt.endFill();
   
    /* scale the target movie clip so it appears as a thumbnail.
       This allows users to quickly view a full image without downloading it every time,
       but unfortunaltey also causes a large initial download. */
    evt._xscale = evt.scale;
    evt._yscale = evt.scale;
    // rotate the current image (and borders) anywyhere from -5 degrees to +5 degrees.
    evt._rotation = 0;
    /* when the target_mc movie clip instance is pressed, begin to drag the current movie clip
       and set some temporary variables so once you are finished rescaling and positioning
       the full image, you can return the instance to its original position. */
    evt.onPress = function() {
        /* set the _xscale and _yscale properties back to 100% so the image appears full sized.
           You're also storing the original X and Y coordinates so you can return the image where you found it. */
        this.startDrag();
        this._xscale = 100;
        this._yscale = 100;
        this.origX = this._x;
        this.origY = this._y;
        // find the depth of the current movie clip, and store it within the movie clip.
        this.origDepth = this.getDepth();
        /* :TRICKY: swap the depth of the current movie clip, with the next highest movie clip of the _parent.
           Effectively this makes the current movie clip the top of the "stack". */
        this.swapDepths(this._parent.getNextHighestDepth());
        // try and center the current movie clip on the Stage.
        this._x = (_global.stageWidth-evt._width+600)/2;
        this._y = (_global.stageHeight-evt._height+350)/2;
        // apply a transition to the movie clip which makes the movie clip flicker for a split second.
        mx.transitions.TransitionManager.start(this, {type:mx.transitions.Photo, direction:0, duration:1, easing:mx.transitions.easing.Strong.easeOut, param1:empty, param2:empty});
    };
    /* when the movie clip instance is press, go back.
       Reset the _xscale and _yscale properties as well as the _x and _y coordinates. */
    evt.onRelease = function() {
        this.stopDrag();
        this._xscale = this.scale;
        this._yscale = this.scale;
        this._x = this.origX;
        this._y = this.origY;
    };
    // if the mouse cursor was released outside of the movie clip, call the onRelease handler.
    evt.onReleaseOutside = evt.onRelease;
};
mcLoader_mcl.addListener(mclListener);
mardi 5 février 2008 à 08:15:47 | Re : photos qui reste

Improve

Bravo poiur ton écrture . . .
--
Tu écrit bien . . . en t k
Seulement il est rare d'avoir des réponses lorsque . . . une si grande écriture . . .
Tu est du Canada ?
Moi aussi . . .
De Qc
--
Bonne Prog . . .
--
Improve
mardi 5 février 2008 à 08:31:30 | Re : photos qui reste

Improve

Je vouvlais dire ' Bravo pour ton écriture ' oubli la fôte d'ortho
--
Bonne Porog . . .
--
Improve


Cette discussion est classée dans : and, clip, movie, evt, gallery


Répondre à ce message

Sujets en rapport avec ce message

Nulle en Actionscript - Besoin d'aide pour ptite modif [ par ciboul31 ] Bonjour à tous,Voilà, mon niveau en actionscript est archi-nul. J'ai récupéré un .fla d'une petite galerie photo.Mon problème : quand on clique sur un photos reste apparente [ par simple560 ] jai instalé une galerie photos dans mon site internet et quand je change de page les photos reste.Comment faire popur les faire disparaitre. merci.le problème, comment effacer une gallerie ? [ par YoMan89 ] Voila j'ai trouvé sur le net, un script qui créé une jolie galerie grâce a un fichier xml qui va chercher les photos que l'on veut mettre dans la gale movie clip / boutton (pas très courant) [ par tetiroelracho ] Bonjours a tous, c'est mon premier post sur cet page web depuis le temps que je suis inscrit...voila donc, j'ai un probleme je suis entrin de fer une Comment atteindre le movie clip d'un swf chargé avec MovieClipLoader [ par gepgep ] Bonjour Après avoir chargé un swf dans un movie clip à l'aide de MovieClipLoader j'aimerais à l'aide d'un bouton cacher, ou montrer certaine partie de stop and gourl sur un clip [ par Ariellelasirene ] Bonsoir, J'ai fait une animation sous forme de clip à insérer dans un site en calque1 Image1. dessous, En calque 2 image 1 un bouton transparent. le b Arrêter un movie clip [ par stevefigueras ] bonjour à tous j'ai un petit souci. J'ai fait un menu avec un sous menu qui appelle des Movie Clip. Seulement lors de la navigation certains movies action quand 2 movie clip se touchent [ par nikko76600 ] hello ! Je commence flash et AS, et j'ai des tonnes de questions qui restent sans réponse, malgré mon ami google et les nombreux forums sur le sujet. comment arreter un movie clip avec un bouton [ par sliper69 ] Bonjour j'ai un petit problème j'ai un petit bonhomme qui cour j y ai mit un petit bouton play; [color=blue]on (release) { play(); } [/color] et u Problème d'affichage movie clip [ par figueline ] Bonjour, Je suis en train de créer un site internet sous flash... J'ai 5 boutons... 3 (Galerie 1...) correspondent à un premier mc... sous forme de


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 2,558 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales