Visualizzazione dei risultati da 1 a 8 su 8

Discussione: image slider + pop-up

  1. #1

    image slider + pop-up

    Salve a tutti/e,

    ho un actionscript che legge e carica immagini da un file xml, le fa scorrere in orizzontale e quando clicco sull'immagine con questa azione apre l'immagine nel pop-up:

    onRelease = function(){fscommand("openWindow","src="+bildObj.b ig_src+"&width="+bildObj.big_width+"&height="+bild Obj.big_height);}

    Come posso modificare questo script affinché apra l'immagine in un movieclip dello stesso swf?

    Grazie.
    En la habana hay una pila 'e locos!

  2. #2
    ciao, creati un mc vuoto, istanzialo "cont" e poi sul frame al posto del tuo codice metti:
    codice:
    cont.onRelease = function(){
    loadMovie(bildObj.big_src)
    }
    -Nextart.it Graphic Solutions

  3. #3
    Ho provato ma mi da come errore questo:

    loadMovie requires between 2 and 3.

    En la habana hay una pila 'e locos!

  4. #4
    si scusa hai ragione......

    creati un mc vuoto, istanzialo "cont", sara' il contenitore dell'immagine grande
    sostituisci thumbs con il nome corretto
    thumbs.onRelease = function(){
    cont.loadMovie(bildObj.big_src)
    }

    -Nextart.it Graphic Solutions

  5. #5
    Mi sa che lo script che c'é prima non é tanto compatibile con questa soluzione che pur sembra giusta:

    te lo posto tutto:

    // set the scale mode of this movie
    Stage.scaleMode = "noScale";
    Stage.align = "TL";

    // load the xml and goto startSlideShow() after
    var images_xml:XML = new XML();
    images_xml.onLoad = startSlideShow;
    images_xml.load("slideshow_images.xml");
    images_xml.ignoreWhite = true;

    // some global settings
    var settings:Object;
    var images:Array;
    var images_count:Number;
    var images_needed:Number;

    var images_active:Array = new Array();
    var images_letzteNr:Number;
    var images_ersteNr:Number = 0;

    var max_r:Number;
    var min_l:Number;

    // the speed according to the mouse-x-position
    var pos_speed:Number = -0.1;

    // the depth of the objects
    var d = 1;

    // this is the invisible square inside witch the images are placed
    // (default value 140, can be set in the xml)
    var a = 140;

    // der Interval
    var bewegeInterval;

    function startSlideShow(success){
    if (success == true) {
    var p:XMLNode = images_xml.firstChild;
    settings = p.firstChild.attributes;
    images = p.lastChild.childNodes;
    images_count = images.length;

    a = Number(settings.a);

    var x = 0;
    var i = 0;

    // we need at least one image
    var sw = Math.max(a,Stage.width);

    while(x < sw){
    // draw the image
    var imageNumber = i % images_count;

    // load the image and register
    images_active.push(createImage(imageNumber,i*a));

    // finally cache the current image number
    images_letzteNr = imageNumber;

    i++;
    x += a;
    max_r = x;
    min_l = 0;
    }

    // store the number of images
    images_needed = i;
    }

    // interval
    bewegeInterval = setInterval(slide, Number(settings.delay), Number(settings.step));
    }

    function slide(stp:Number){
    // moves all images

    stp = Math.round(stp * pos_speed);

    min_l += stp;
    max_r += stp;
    /*
    trace("x-bounds: " + min_l + " - " + max_r);
    trace("nr-bounds 0: " + images_ersteNr + " - " + images_letzteNr);
    */

    var len = images_active.length;

    var new_images_active = new Array();

    for(var k = 0; k < len; k++){

    var b:MovieClip = images_active[k];
    b._x += stp;
    // trace(b + ": x=" + b._x + ", max_r=" + max_r);

    if(b._x <= -a){
    // trace("unload left");
    b.unloadMovie();
    min_l += a;
    images_ersteNr = (images_ersteNr + 1) % images_count
    }
    else if(b._x > Stage.width){
    // trace("unload right");
    b.unloadMovie();
    max_r -= a;
    images_letzteNr = (((images_letzteNr - 1) % images_count) + images_count) % images_count;
    }
    else {
    // behalten
    new_images_active.push(b);
    }

    if(max_r < Stage.width){
    // trace("create right");
    imageNumber = (images_letzteNr + 1) % images_count;
    new_images_active.push(createImage(imageNumber,max _r));
    images_letzteNr = imageNumber;
    max_r += a;
    }
    if(min_l > 0){
    // trace("create left");
    imageNumber = (((images_ersteNr - 1) % images_count) + images_count) % images_count;
    new_images_active.unshift(createImage(imageNumber, min_l - a));
    images_ersteNr = imageNumber;
    min_l -= a;
    }
    }

    // trace("nr-bounds 1: " + images_ersteNr + " - " + images_letzteNr);
    images_active = new_images_active;

    // update...
    updateAfterEvent();
    }

    function createImage(imageNumber:Number, x:Number):MovieClip{
    var bildObj = images[imageNumber].attributes;

    var bildBreite = Number(bildObj.width);
    var bildHoehe = Number(bildObj.height);

    var bildX = Math.round(a - bildBreite)/2;
    var bildY = Math.round(a - bildHoehe)/2;

    var container = _root.createEmptyMovieClip("bild" + d,d);
    container._x = x;

    // depth for the next movieclip
    d++;

    // we put two images inside that container: one for the border and the image itself
    var rahmen:MovieClip = container.attachMovie("box","rahmen",1);
    var c = new Color(rahmen);
    c.setRGB(settings.bordercolor);

    rahmen._width = bildBreite + 2;
    rahmen._height = bildHoehe + 2;

    rahmen._x = bildX - 1;
    rahmen._y = bildY - 1;

    // the event handler is set to the border
    if(bildObj.big_src != undefined) rahmen.onRelease = function(){fscommand("openWindow","src="+bildObj.b ig_src+"&width="+bildObj.big_width+"&height="+bild Obj.big_height);}

    var bild = container.createEmptyMovieClip("bild",2);
    loadMovie(bildObj.src, bild);

    bild._x = bildX;
    bild._y = bildY;

    return container;
    }

    this.onMouseMove = function(){
    pos_speed = -Math.round(10 * ((2*_xmouse)-Stage.width)/Stage.width) / 10;
    }


    In grassetto la funzione incriminata!
    En la habana hay una pila 'e locos!

  6. #6
    se sostituisci
    codice:
    if(bildObj.big_src != undefined) rahmen.onRelease = function(){fscommand("openWindow","src="+bildObj.big_src+"&width="+bildObj.big_width+"&height="+bildObj.big_height);}
    con questo:
    codice:
    if(bildObj.big_src != undefined) rahmen.onRelease = function(){
    cont.loadMovie(bildObj.big_src)
    }
    cosi' gli dici se e' diverso da undefined caricami dentro cont l'imamgine....

    cosa ti risponde?
    -Nextart.it Graphic Solutions

  7. #7
    L'avevo sostituito ma non funzionava e adesso invece sì!!!!
    Mistero, ma finalmente risolto!!!

    Grazie mille!!!!!

    En la habana hay una pila 'e locos!

  8. #8
    bene........figurati...
    ciao
    -Nextart.it Graphic Solutions

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.