Pagina 1 di 5 1 2 3 ... ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 41
  1. #1

    [flash] Problema con gallery in primo piano

    Ciao a tutti.
    Sto utilizzando su un sito che sto creando, la gallery tween presente fra i samples di flash8.

    L'ho inserita in "scene2" e funziona perfettamente. Il problema è che quando torno sulla scene1 o in qualsiasi altra parte del sito, le thumbnail rimangono in sovrapposizione a tutto.

    Come posso fare per poterla far sparire quando voglio continuare a navigare nel sito?

    Vi prego aiutatemi!
    Un saluto ancora

  2. #2

    Re: [flash] Problema con gallery in primo piano

    Originariamente inviato da barbadillo
    Ciao a tutti.
    Sto utilizzando su un sito che sto creando, la gallery tween presente fra i samples di flash8.

    L'ho inserita in "scene2" e funziona perfettamente. Il problema è che quando torno sulla scene1 o in qualsiasi altra parte del sito, le thumbnail rimangono in sovrapposizione a tutto.

    Come posso fare per poterla far sparire quando voglio continuare a navigare nel sito?

    Vi prego aiutatemi!
    Un saluto ancora
    dipende da come carica le thumbnail anzi dove le carica...
    quindi cè bisogno dello script che usi
    io nn ho flash8 e nn so l'es di cui parli
    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

  3. #3
    questo è lo script:



    /*
    Dynamic Movie Clips Example
    The Flash gallery is created at runtime from an XML file.
    Images are scaled to 20% of their original size,
    but you can see the full size image by clicking an image and keeping the mouse button pressed.
    */

    // 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 = 60;
    _global.thisY = 50;

    /* 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 = 800;
    _global.stageHeight = 600;

    // 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_tween.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 5 columns of images, start a new row.
    if ((i+1)%5 == 0) {
    // reset the X and Y positions
    _global.thisX = 60;
    _global.thisY +=150;
    } else {
    _global.thisX += 120+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 = 8;
    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+20;
    evt._yscale = evt.scale+20;
    // rotate the current image (and borders) anywyhere from -5 degrees to +5 degrees.
    evt._rotation = Math.round(Math.random()*-10)+5;
    /* 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() {
    // start dragging the current clip.
    this.startDrag();
    /* 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._xscale = 150;
    this._yscale = 150;
    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 = 220;
    this._y = 150;
    // 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 released, stop dragging the movie clip.
    Reset the _xscale and _yscale properties as well as the _x and _y coordinates. */
    evt.onRelease = function() {
    this.stopDrag();
    this._xscale = this.scale+20;
    this._yscale = this.scale+20;
    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);

  4. #4

  5. #5
    scusami ... se ti rispondo solo adesso
    ho visto il codice velocemente
    cmq ti basterebbe fare una funzione di eliminazione dei clip che attacchi sullo stage
    e la richiami quando passi da una sezione all'altra

    prova con una cosa del genere

    function Rimuovi(){
    for (a=0; a<galleryLength; a++){
    _root["image"+a+"_mc"].removeMovieClip();

    };
    };
    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

  6. #6
    Scusami se ti stresso, ma con l'action script non ci capisco una mazza.

    Cosa intendi con copiare sullo stage?

    Poi basta che io copi quello che mi hai postato o devo anche fare una funzione di richiamo?

  7. #7
    Originariamente inviato da barbadillo
    Scusami se ti stresso, ma con l'action script non ci capisco una mazza.

    Cosa intendi con copiare sullo stage?

    Poi basta che io copi quello che mi hai postato o devo anche fare una funzione di richiamo?
    >Cosa intendi con copiare sullo stage?
    cioè copiare chi lo ha detto

    cmq
    ti basta aggiungere quella funzione allo script che hai postato
    e richiamare la stessa quando ti serve
    x richiamarla ti basta

    Rimuovi();

    se sei nella root oppure

    _root.Rimuovi(){

    se stai in un clip

    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

  8. #8
    Ho il computer che fa cio che vuole.

    Dicevo scusa. Ho provato ma non mi funge.

    Ho attaccato (scusa avevo sbagliato termine prima) il tuo codice in fondo al mio script poi sono andato sulla scena 1 e ho provato in tutte e due le maniere che mi hai postatao per richiamare la funzione ma non mi cambia la situazione. Con "_root.Rimuovi(){" mi da errore di sintassi

  9. #9
    Originariamente inviato da barbadillo
    Ho il computer che fa cio che vuole.

    Dicevo scusa. Ho provato ma non mi funge.

    Ho attaccato (scusa avevo sbagliato termine prima) il tuo codice in fondo al mio script poi sono andato sulla scena 1 e ho provato in tutte e due le maniere che mi hai postatao per richiamare la funzione ma non mi cambia la situazione. Con "_root.Rimuovi(){" mi da errore di sintassi
    scusami una parentesi di troppo
    prova con solo

    _root.Rimuovi()

    senza parentesi graffa
    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

  10. #10
    Nada. Non vuole funzionare. Rischio la depressione.

    Mi manca solo questo e poi sarei a posto pronto alla pubblicazione e invece è una settimana che rimando.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.