Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    problema visualizzazione foto

    Mi scuso con i moderatori ma non avevo visto la sezione specifica quindi posto anche qui se volete potete cancellare quello in generale.

    action script galleria foto
    Buongiorno a tutti ho cominciato da pochissimo ad interessarmi a flash per creare un visualizzatore di foto ho trovato un action script che visualizza le foto tutte in una scena costruendo la galleria.
    carica le foto prendendo i dati da un file esterno.
    le thumb vengono visualizzate sulla sinistra e clikkando sulla thumb l'immagine viene visualizzata sulla destra, vorrei invece che clikkando sulle thumb scomparissero e al loro posto venga visualizzata l'immagine corrispondente, viceversa clikkando sull'immagine riappaiano le thumb in pratica dovrebbe funzionare così

    http://www.webworksite.com/photogallery.shtml

    Questo è l'action script che ho trovato e che vorrei modificare





    var imglist = new XML();

    var borderspace=2;
    loadText.text="";
    loadBar._width ="";

    imglist.ignoreWhite = true;

    loadText.text="loading xml";
    imglist.onLoad = function() {
    createGalerie();
    };

    imglist.load("eyelash_xml_render.php");


    //Création de la galerie
    function createGalerie() {
    //liste des images
    var photo_dir = imglist.firstChild.attributes.images;
    var thumb_dir = imglist.firstChild.attributes.thumbnails;

    loadText.text="loading images from " + photo_dir;
    var eyelash_nodes = imglist.firstChild.childNodes;


    for (var i = 0; i<eyelash_nodes.length; i++) {

    var image_name = eyelash_nodes[i].attributes.name;

    //create a clip / move to size / position
    var img = this.createEmptyMovieClip("img"+i, i);
    var nb_columns = 3;
    img._x = (i%nb_columns)*60+4;
    img._y = Math.floor(i/nb_columns)*60+10;
    //load thumbnail
    var view = img.createEmptyMovieClip("view", 0);
    view.loadMovie(thumb_dir+image_name);
    //On enregistre les infos
    img.image_name = photo_dir+image_name;
    img.width = eyelash_nodes[i].attributes.width;
    img.height = eyelash_nodes[i].attributes.height;
    //display image on click
    img.onRelease = function() {
    //popup(this.nom, this.width, this.height);
    imageLoad(this.image_name);
    };
    //Create border around thumbnail
    var border=_root.createEmptyMovieClip("square"+i, 50 + i);
    _root["square"+i].lineStyle(1, 0xaaaaaa, 100);
    _root["square"+i].beginFill(0x99CCCC, 0);
    _root["square"+i].moveTo(img._x - borderspace -1, img._y - borderspace -1 );
    _root["square"+i].lineTo(img._x - borderspace -1 , img._y+50+ borderspace);
    _root["square"+i].lineTo(img._x+50 +borderspace, img._y + 50 + borderspace);
    _root["square"+i].lineTo(img._x+50 +borderspace, img._y - borderspace -1);
    _root["square"+i].endFill();


    img.onRollOver = function() {
    gFadeOut(this,10, 20);};
    img.onRollOut = function() {gFadeIn(this, 10, 90)};
    }
    var main = this.createEmptyMovieClip("main", i+1);
    main._x=200;
    main._y=10;


    imageLoad(photo_dir + eyelash_nodes[0].attributes.name);
    }
    function imageLoad(filename)
    {
    timeout=250;
    main._alpha=0;
    main.loadMovie(filename);
    img_loading_ID=setInterval(LoadingStat
    us,250);
    }
    function LoadingStatus(){

    bl=main.getBytesLoaded()
    bt=main.getBytesTotal()
    if (bt!=0) {per=Math.round((bl/bt)*100); }
    else {per=0;}
    loadBar._width = per ;
    loadText.text = "loading..." + Math.round(bl / 1024) + " Kb ... " + per + "%";

    if(per>=100){
    clearInterval(img_loading_ID);
    fadeOut = setInterval(fadeOut,0.5);
    fadeInt = setInterval(fadeIn,1);
    loadText.text = "image loaded : " + Math.round(bl / 1024) + " kb.";
    mainBorder();
    }

    }

    function mainBorder()
    {
    _root.createEmptyMovieClip("frame",20);
    _root.frame.lineStyle(1, 0xaaaaaa, 100);
    _root.frame.beginFill(0x99CCCC, 0);
    _root.frame.moveTo(main._x- borderspace -1, main._y - borderspace -1);
    _root.frame.lineTo(main._x- borderspace -1,main._y + main._height+ borderspace );
    _root.frame.lineTo(main._x + main._width+ borderspace, main._y + main._height+ borderspace);
    _root.frame.lineTo(main._x + main._width+ borderspace, main._y- borderspace -1 );
    _root.frame.endFill();
    }
    function fadeIn(){
    main._alpha+= 1;
    if(main._alpha>99){
    main._alpha = 100;clearInterval(fadeInt);}
    }
    function fadeOut(){
    main._alpha-= 1;
    if(main._alpha<1){
    main._alpha = 0;clearInterval(fadeOut);}
    }
    gFadeOut = function (mc, step, target) {
    mc.onEnterFrame = function() {
    newAlpha = mc._alpha - step;
    if (newAlpha <= target) {
    newAlpha = target;
    delete mc.onEnterFrame;
    }
    mc._alpha = newAlpha;
    };
    };
    gFadeIn = function (mc, step, target) {
    mc.onEnterFrame = function() {
    newAlpha = mc._alpha + step;
    if (newAlpha >= target) {
    newAlpha = target;
    delete mc.onEnterFrame;
    }
    mc._alpha = newAlpha;
    };
    };


    Ringrazio fin da ora quell'anima pia che vorrà aiutarmi

  2. #2

  3. #3
    Grazie rampox ho visto e ho risposto anche io se vuoi possiamo continuare qui la discussione ti sarei molto grato se vorrai seguirmi vorrei capire un pò meglio il funzionamento
    Ciao

  4. #4
    Ho tolto un pò di cose dallo script per renderlo più leggibile eccolo


    var imglist = new XML();

    var borderspace=2;
    loadText.text="";
    loadBar._width ="";

    imglist.ignoreWhite = true;

    loadText.text="loading xml";
    imglist.onLoad = function() {
    createGalerie();
    };

    imglist.load("eyelash_xml_render.php");


    //Création de la galerie
    function createGalerie() {
    //liste des images
    var photo_dir = imglist.firstChild.attributes.images;
    var thumb_dir = imglist.firstChild.attributes.thumbnails;

    loadText.text="loading images from " + photo_dir;
    var eyelash_nodes = imglist.firstChild.childNodes;


    for (var i = 0; i<eyelash_nodes.length; i++) {

    var image_name = eyelash_nodes[i].attributes.name;

    //create a clip / move to size / position
    var img = this.createEmptyMovieClip("img"+i, i);
    var nb_columns = 3;
    img._x = (i%nb_columns)*60+4;
    img._y = Math.floor(i/nb_columns)*60+10;
    //load thumbnail
    var view = img.createEmptyMovieClip("view", 0);
    view.loadMovie(thumb_dir+image_name);
    //On enregistre les infos
    img.image_name = photo_dir+image_name;
    img.width = eyelash_nodes[i].attributes.width;
    img.height = eyelash_nodes[i].attributes.height;
    //display image on click
    img.onRelease = function() {
    //popup(this.nom, this.width, this.height);
    imageLoad(this.image_name);
    };


    img.onRollOver = function() {
    gFadeOut(this,10, 20);};
    img.onRollOut = function() {gFadeIn(this, 10, 90)};
    }
    var main = this.createEmptyMovieClip("main", i+1);
    main._x=200;
    main._y=10;


    imageLoad(photo_dir + eyelash_nodes[0].attributes.name);
    }
    function imageLoad(filename)
    {
    timeout=250;
    main._alpha=0;
    main.loadMovie(filename);
    img_loading_ID=setInterval(LoadingStatus,250);
    }
    function LoadingStatus(){

    bl=main.getBytesLoaded()
    bt=main.getBytesTotal()
    if (bt!=0) {per=Math.round((bl/bt)*100); }
    else {per=0;}
    loadBar._width = per ;
    loadText.text = "loading..." + Math.round(bl / 1024) + " Kb ... " + per + "%";

    if(per>=100){
    clearInterval(img_loading_ID);
    fadeOut = setInterval(fadeOut,0.5);
    fadeInt = setInterval(fadeIn,1);
    loadText.text = "image loaded : " + Math.round(bl / 1024) + " kb.";
    mainBorder();
    }

    }


    function fadeIn(){
    main._alpha+= 1;
    if(main._alpha>99){
    main._alpha = 100;clearInterval(fadeInt);}
    }
    function fadeOut(){
    main._alpha-= 1;
    if(main._alpha<1){
    main._alpha = 0;clearInterval(fadeOut);}
    }
    gFadeOut = function (mc, step, target) {
    mc.onEnterFrame = function() {
    newAlpha = mc._alpha - step;
    if (newAlpha <= target) {
    newAlpha = target;
    delete mc.onEnterFrame;
    }
    mc._alpha = newAlpha;
    };
    };
    gFadeIn = function (mc, step, target) {
    mc.onEnterFrame = function() {
    newAlpha = mc._alpha + step;
    if (newAlpha >= target) {
    newAlpha = target;
    delete mc.onEnterFrame;
    }
    mc._alpha = newAlpha;
    };
    };

  5. #5
    Ho modificato così l' as ma non funziona chi mi può aiutare?

    var imglist = new XML();

    var borderspace=2;
    loadText.text="";
    loadBar._width ="";

    imglist.ignoreWhite = true;

    loadText.text="loading xml";
    imglist.onLoad = function() {
    this.onRelease = function() {
    //popup(this.nom, this.width, this.height);


    imageLoad(img.image_name);
    };


    createGalerie();

    };

    imglist.load("eyelash_xml_render.php");


    //Création de la galerie
    function createGalerie() {
    //liste des images
    var photo_dir = imglist.firstChild.attributes.images;
    var thumb_dir = imglist.firstChild.attributes.thumbnails;

    loadText.text="loading images from " + photo_dir;
    var eyelash_nodes = imglist.firstChild.childNodes;


    for (var i = 0; i<eyelash_nodes.length; i++) {

    var image_name = eyelash_nodes[i].attributes.name;

    //create a clip / move to size / position
    var img = this.createEmptyMovieClip("img"+i, i);
    var nb_columns = 3;
    img._x = (i%nb_columns)*60+250;
    img._y = Math.floor(i/nb_columns)*60+10;
    //load thumbnail
    var view = img.createEmptyMovieClip("view", 0);
    view.loadMovie(thumb_dir+image_name);
    //On enregistre les infos
    img.image_name = photo_dir+image_name;
    img.width = eyelash_nodes[i].attributes.width;
    img.height = eyelash_nodes[i].attributes.height;
    //display image on click




    img.onRollOver = function() {
    gFadeOut(this,10, 20);};
    img.onRollOut = function() {gFadeIn(this, 10, 90)};
    }
    var main = this.createEmptyMovieClip("main", i+1);
    main._x=200;
    main._y=10;


    //imageLoad(photo_dir + eyelash_nodes[0].attributes.name);
    }
    function imageLoad(filename)
    {
    timeout=250;
    main._alpha=0;
    main.loadMovie(filename);
    img_loading_ID=setInterval(LoadingStatus,250);


    }
    function LoadingStatus(){

    bl=main.getBytesLoaded()
    bt=main.getBytesTotal()
    if (bt!=0) {per=Math.round((bl/bt)*100); }
    else {per=0;}
    loadBar._width = per ;
    loadText.text = "loading..." + Math.round(bl / 1024) + " Kb ... " + per + "%";

    if(per>=100){
    clearInterval(img_loading_ID);
    fadeOut = setInterval(fadeOut,0.5);
    fadeInt = setInterval(fadeIn,1);
    loadText.text = "image loaded : " + Math.round(bl / 1024) + " kb.";
    mainBorder();
    }

    }


    function fadeIn(){
    main._alpha+= 1;
    if(main._alpha>99){
    main._alpha = 100;clearInterval(fadeInt);}
    }
    function fadeOut(){
    main._alpha-= 1;
    if(main._alpha<1){
    main._alpha = 0;clearInterval(fadeOut);}
    }
    gFadeOut = function (mc, step, target) {
    mc.onEnterFrame = function() {
    newAlpha = mc._alpha - step;
    if (newAlpha <= target) {
    newAlpha = target;
    delete mc.onEnterFrame;
    }
    mc._alpha = newAlpha;
    };
    };
    gFadeIn = function (mc, step, target) {
    mc.onEnterFrame = function() {
    newAlpha = mc._alpha + step;
    if (newAlpha >= target) {
    newAlpha = target;
    delete mc.onEnterFrame;
    }
    mc._alpha = newAlpha;
    };
    };

  6. #6
    up!

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 © 2024 vBulletin Solutions, Inc. All rights reserved.