Visualizzazione dei risultati da 1 a 4 su 4

Discussione: banner + xml

  1. #1
    Utente di HTML.it
    Registrato dal
    May 2006
    Messaggi
    19

    banner + xml

    Ciao... ho trovato un'interessante script girando in rete.....
    e' un banner che carica immagini e testo da un file xml....ha uno slide automatico ed anche un simpatico effetto elastico...

    il mio problema e' che le immagini e il testo le carica randon ...pur avendoci anche i tasti next e prev....non segue un ordine.....
    ora io ho il codice che ho provato anche a studiare ma non capisco proprio qual 'e' il parametro che va settato.....
    qualcuno di buon cuore puo' darmi una dritta?????????????

    grazieeeeeeeeeeeee



    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    image_list = new Array();
    heading_list = new Array();
    price_list = new Array();
    trial_list = new Array();
    buy_list = new Array();
    var fIndex:Number;
    var slide_noX:Number = 608;
    url_list = new Array();
    desc_list = new Array();

    var pic_xml = new XML();
    pic_xml.load("banner.xml");
    pic_xml.ignoreWhite = true;
    pic_xml.onLoad = function() {
    var nodes:Array = this.firstChild.childNodes;
    for (var i = 0; i<nodes.length; i++) {
    image_list.push(nodes[i].attributes.image);
    heading_list.push(nodes[i].attributes.heading);
    price_list.push(nodes[i].attributes.price);
    trial_list.push(nodes[i].attributes.trialurl);
    buy_list.push(nodes[i].attributes.buynowurl);
    desc_list.push(nodes[i].childNodes[0].nodeValue);

    tn_group["tn"+0].link_group.links.htmlText = nodes[0].childNodes[1].nodeValue;
    tn_group["tn"+0].link_group2.links_txt.htmlText = nodes[0].childNodes[2].nodeValue;
    tn_group["tn"+0].launch_mc.launch.text = launch_list[0];
    tn_group["tn"+0].launch_mc.launch_btn.onRelease = function() {
    getURL(launchurl_list[0]);
    };

    var my_fmt:TextFormat = new TextFormat();
    my_fmt.color = txtcolor_list[i];

    tn_group.tn.duplicateMovieClip("tn"+i,i);

    _root.attachMovie("slide_no","slide_no"+i,i);
    _root["slide_no"+i]._x = slide_noX;
    slide_noX = slide_noX+10;
    _root["slide_no"+i]._y = 130;
    _root["slide_no"+i].nu.no.text = i+1;

    prev_btn._x = _root["slide_no"+0]._x-60;
    prev_btn._y = _root["slide_no"+0]._y;
    next_btn._x = (_root["slide_no"+0]._x)+_root["slide_no"+0]._width*nodes.length;
    next_btn._y = _root["slide_no"+0]._y;

    move_slide.swapDepths(i);
    move_slide.onRollOver = function() {
    move_slide.useHandCursor = false;
    };
    move_slide._x = _root["slide_no"+0]._x;

    move_slide._x = _root["slide_no"+0]._x;
    move_slide._y = _root["slide_no"+0]._y;

    tn_group["tn"+0].trial_btn.onRelease = function() {
    getURL(trial_list[(this._parent._parent._parent.move_slide.nu.no.tex t)-1]);
    };
    tn_group["tn"+0].buy_btn.onRelease = function() {
    getURL(buy_list[(this._parent._parent._parent.move_slide.nu.no.tex t)-1]);
    };
    tn_group["tn"+0].contents.htmlText = nodes[0].childNodes[0].nodeValue;
    tn_group["tn"+0].heading.text = heading_list[0];
    tn_group["tn"+0].heading.setTextFormat(my_fmt);
    tn_group["tn"+0].price.text = price_list[0];
    move_slide.nu.no.text = 1;
    next_btn.btn.onRollOver = function() {
    clearInterval(intNum);
    };
    next_btn.btn.onRollOut = function() {
    intNum = setInterval(automove, 10000);
    };
    prev_btn.btn.onRelease = function() {
    clearInterval(intNum);
    pFrame();
    };
    prev_btn.btn.onRollOver = function() {
    clearInterval(intNum);
    };
    prev_btn.btn.onRollOut = function() {
    intNum = setInterval(automove, 10000);
    };
    _root["slide_no"+i].slide_btn.onRollOver = function() {
    clearInterval(intNum);
    };
    _root["slide_no"+i].slide_btn.onRollOut = function() {
    intNum = setInterval(automove, 10000);
    };

    _root["slide_no"+i].slide_btn.onRelease = function() {
    clearInterval(intNum);
    var xpos:Number = this._parent._x;
    fIndex = parseInt(getProperty(this._parent, _name).substring(8, sName));

    if (dummy._alpha == 100) {
    if (dummy2._alpha == 0) {
    tn_group["tn"+0].link_group._visible = true;
    tn_group["tn"+0].link_group2._visible = true;
    tn_group["tn"+0].launch_mc._visible = true;
    }
    var aniM:Tween = new Tween(move_slide, "_x", Elastic.easeOut, _root.move_slide._x, xpos, .5, 1, true);
    move_slide.nu.no.text = fIndex+1;
    if (fIndex>0) {
    tn_group["tn"+0].link_group._visible = false;
    tn_group["tn"+0].link_group2._visible = false;
    tn_group["tn"+0].launch_mc._visible = false;


    }
    tn_group["tn"+0].contents.htmlText = nodes[getProperty(this._parent, _name).substring(8, sName)].childNodes[0].nodeValue;
    tn_group["tn"+0].heading.text = heading_list[getProperty(this._parent, _name).substring(8, sName)];
    tn_group["tn"+0].price.text = price_list[getProperty(this._parent, _name).substring(8, sName)];
    tn_group["tn"+0].tn_pic.loadMovie(image_list[getProperty(this._parent, _name).substring(8, sName)]);
    tn_group["tn"+0].tn_pic._alpha = 0;
    preload();
    tn_group["tn"+0].contents._y = 200;
    tn_group["tn"+0].heading._y = 200;
    tn_group["tn"+0].price._y = 200;
    tn_group["tn"+0].buy_btn._y = 200;
    tn_group["tn"+0].trial_btn._y = 200;
    tn_group["tn"+0].link_group._y = 200;
    tn_group["tn"+0].link_group2._y = 200;
    tn_group["tn"+0].launch_mc._y = 200;
    }
    };
    }
    tn_group["tn"+0].tn_pic.loadMovie(image_list[0]);
    tn_group["tn"+0].tn_pic._alpha = 0;
    preload();
    };
    intNum = setInterval(automove, 10000);
    next_btn.btn.onRelease = function() {
    clearInterval(intNum);
    nFrame();
    };
    fIndex = 0;

    function preload() {
    onEnterFrame = function () {
    total_loaded = tn_group["tn"+0].tn_pic.getBytesTotal();
    percent = Math.round(tn_group["tn"+0].tn_pic.getBytesLoaded()/total_loaded*100);
    if (percent == 100) {
    tn_group["tn"+0].tn_pic._alpha += 5;
    tn_group["tn"+0].contents._x = tn_group["tn"+0].tn_pic._x+tn_group["tn"+0].tn_pic._width+20;
    tn_group["tn"+0].heading._x = tn_group["tn"+0].tn_pic._x+tn_group["tn"+0].tn_pic._width+20;
    tn_group["tn"+0].link_group._x = tn_group["tn"+0].tn_pic._x+tn_group["tn"+0].tn_pic._width+20;
    tn_group["tn"+0].link_group2._x = tn_group["tn"+0].tn_pic._x+tn_group["tn"+0].tn_pic._width+150;
    }
    if (tn_group["tn"+0].tn_pic._alpha>100) {
    delete this.onEnterFrame;
    anim();
    }
    };

    }

    function anim() {

    var anm:Tween = new Tween(tn_group["tn"+0].contents, "_y", Elastic.easeOut, 200, 16.4, 2, 1, true);
    var anm:Tween = new Tween(tn_group["tn"+0].heading, "_y", Elastic.easeOut, 200, -10, 2, 1, true);
    var anm:Tween = new Tween(tn_group["tn"+0].price, "_y", Elastic.easeOut, 200, 70, 2, 1, true);
    var anm:Tween = new Tween(tn_group["tn"+0].trial_btn, "_y", Elastic.easeOut, 200, 20, 2, 1, true);
    var anm:Tween = new Tween(tn_group["tn"+0].buy_btn, "_y", Elastic.easeOut, 200, 45, 2, 1, true);
    var anm:Tween = new Tween(tn_group["tn"+0].link_group, "_y", Elastic.easeOut, 300, 70, 2, 1, true);
    var anm:Tween = new Tween(tn_group["tn"+0].link_group2, "_y", Elastic.easeOut, 200, 70, 2, 1, true);
    var anm:Tween = new Tween(tn_group["tn"+0].launch_mc, "_y", Elastic.easeOut, 200, 70, 2, 1, true);


    var anm:Tween = new Tween(dummy, "_alpha", Elastic.easeOut, 0, 100, 2, 1, true);
    var anm:Tween = new Tween(dummy2, "_alpha", Elastic.easeOut, 100, 0, 3, 1, true);
    }

    function nFrame() {
    if (fIndex == heading_list.length-1) {
    fIndex = 0;


    if (dummy._alpha == 100) {
    if (dummy2._alpha == 0) {
    tn_group["tn"+0].link_group._visible = true;
    tn_group["tn"+0].link_group2._visible = true;
    tn_group["tn"+0].launch_mc._visible = true;
    }
    if (fIndex>0) {
    tn_group["tn"+0].link_group._visible = false;
    tn_group["tn"+0].link_group2._visible = false;
    tn_group["tn"+0].launch_mc._visible = false;

    }
    tn_group["tn"+0].contents.htmlText = desc_list[fIndex];
    tn_group["tn"+0].heading.text = heading_list[fIndex];
    tn_group["tn"+0].price.text = price_list[fIndex];
    tn_group["tn"+0].tn_pic.loadMovie(image_list[fIndex]);
    tn_group["tn"+0].tn_pic._alpha = 0;
    preload();
    tn_group["tn"+0].contents._y = 200;
    tn_group["tn"+0].heading._y = 200;
    tn_group["tn"+0].price._y = 200;
    tn_group["tn"+0].buy_btn._y = 200;
    tn_group["tn"+0].trial_btn._y = 200;
    tn_group["tn"+0].link_group._y = 200;
    tn_group["tn"+0].link_group2._y = 200;
    tn_group["tn"+0].launch_mc._y = 200;

    var aniM:Tween = new Tween(move_slide, "_x", Elastic.easeOut, _root.move_slide._x, _root["slide_no"+fIndex]._x, .5, 1, true);
    move_slide.nu.no.text = fIndex+1;
    }
    } else {

    fIndex++;

    if (dummy._alpha == 100) {
    if (dummy2._alpha == 0) {
    tn_group["tn"+0].link_group._visible = true;
    tn_group["tn"+0].link_group2._visible = true;
    tn_group["tn"+0].launch_mc._visible = true;
    }
    if (fIndex>0) {
    tn_group["tn"+0].link_group._visible = false;
    tn_group["tn"+0].link_group2._visible = false;
    tn_group["tn"+0].launch_mc._visible = false;
    }
    tn_group["tn"+0].contents.htmlText = desc_list[fIndex];
    tn_group["tn"+0].heading.text = heading_list[fIndex];
    tn_group["tn"+0].price.text = price_list[fIndex];
    tn_group["tn"+0].tn_pic.loadMovie(image_list[fIndex]);
    tn_group["tn"+0].tn_pic._alpha = 0;
    preload();
    tn_group["tn"+0].contents._y = 200;
    tn_group["tn"+0].heading._y = 200;
    tn_group["tn"+0].price._y = 200;
    tn_group["tn"+0].buy_btn._y = 200;
    tn_group["tn"+0].trial_btn._y = 200;
    tn_group["tn"+0].link_group._y = 200;
    tn_group["tn"+0].link_group2._y = 200;
    tn_group["tn"+0].launch_mc._y = 200;

    var aniM:Tween = new Tween(move_slide, "_x", Elastic.easeOut, _root.move_slide._x, _root["slide_no"+fIndex]._x, .5, 1, true);
    move_slide.nu.no.text = fIndex+1;
    }
    }
    }

    function pFrame() {
    if (fIndex == 0) {
    fIndex = heading_list.length-1;

    if (dummy._alpha == 100) {
    if (dummy2._alpha == 0) {
    tn_group["tn"+0].link_group._visible = true;
    tn_group["tn"+0].link_group2._visible = true;
    tn_group["tn"+0].launch_mc._visible = true;
    }
    if (fIndex>0) {
    tn_group["tn"+0].link_group._visible = false;
    tn_group["tn"+0].link_group2._visible = false;
    tn_group["tn"+0].launch_mc._visible = false;
    }
    tn_group["tn"+0].contents.htmlText = desc_list[fIndex];
    tn_group["tn"+0].heading.text = heading_list[fIndex];
    tn_group["tn"+0].price.text = price_list[fIndex];
    tn_group["tn"+0].tn_pic.loadMovie(image_list[fIndex]);
    tn_group["tn"+0].tn_pic._alpha = 0;
    preload();
    tn_group["tn"+0].contents._y = 200;
    tn_group["tn"+0].heading._y = 200;
    tn_group["tn"+0].price._y = 200;
    tn_group["tn"+0].buy_btn._y = 200;
    tn_group["tn"+0].trial_btn._y = 200;
    tn_group["tn"+0].link_group._y = 200;
    tn_group["tn"+0].link_group2._y = 200;
    tn_group["tn"+0].launch_mc._y = 200;

    var aniM:Tween = new Tween(move_slide, "_x", Elastic.easeOut, _root.move_slide._x, _root["slide_no"+fIndex]._x, .5, 1, true);
    move_slide.nu.no.text = fIndex+1;

    }
    } else {

    fIndex--;

    if (dummy._alpha == 100) {
    if (dummy2._alpha == 0) {
    tn_group["tn"+0].link_group._visible = true;
    tn_group["tn"+0].link_group2._visible = true;
    tn_group["tn"+0].launch_mc._visible = true;

    }
    if (fIndex>0) {
    tn_group["tn"+0].link_group._visible = false;
    tn_group["tn"+0].link_group2._visible = false;
    tn_group["tn"+0].launch_mc._visible = false;
    }

    tn_group["tn"+0].contents.htmlText = desc_list[fIndex];
    tn_group["tn"+0].heading.text = heading_list[fIndex];
    tn_group["tn"+0].price.text = price_list[fIndex];
    tn_group["tn"+0].tn_pic.loadMovie(image_list[fIndex]);
    tn_group["tn"+0].tn_pic._alpha = 0;
    preload();
    tn_group["tn"+0].contents._y = 200;
    tn_group["tn"+0].heading._y = 200;
    tn_group["tn"+0].price._y = 200;
    tn_group["tn"+0].buy_btn._y = 200;
    tn_group["tn"+0].trial_btn._y = 200;
    tn_group["tn"+0].link_group._y = 200;
    tn_group["tn"+0].link_group2._y = 200;
    tn_group["tn"+0].launch_mc._y = 200;

    var aniM:Tween = new Tween(move_slide, "_x", Elastic.easeOut, _root.move_slide._x, _root["slide_no"+fIndex]._x, .5, 1, true);
    move_slide.nu.no.text = fIndex+1;
    }
    }
    }



    var intNum:Number;
    Noemi

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2006
    Messaggi
    19
    function automove() {
    if (fIndex == heading_list.length-1) {
    fIndex = 0;


    if (dummy._alpha == 100) {
    if (dummy2._alpha == 0) {
    tn_group["tn"+0].link_group._visible = true;
    tn_group["tn"+0].link_group2._visible = true;
    tn_group["tn"+0].launch_mc._visible = true;
    }
    if (fIndex>0) {
    tn_group["tn"+0].link_group._visible = false;
    tn_group["tn"+0].link_group2._visible = false;
    tn_group["tn"+0].launch_mc._visible = false;

    }
    tn_group["tn"+0].contents.htmlText = desc_list[fIndex];
    tn_group["tn"+0].heading.text = heading_list[fIndex];
    tn_group["tn"+0].price.text = price_list[fIndex];
    tn_group["tn"+0].tn_pic.loadMovie(image_list[fIndex]);
    tn_group["tn"+0].tn_pic._alpha = 0;
    preload();
    tn_group["tn"+0].contents._y = 200;
    tn_group["tn"+0].heading._y = 200;
    tn_group["tn"+0].price._y = 200;
    tn_group["tn"+0].buy_btn._y = 200;
    tn_group["tn"+0].trial_btn._y = 200;
    tn_group["tn"+0].link_group._y = 200;
    tn_group["tn"+0].link_group2._y = 200;
    tn_group["tn"+0].launch_mc._y = 200;

    var aniM:Tween = new Tween(move_slide, "_x", Elastic.easeOut, _root.move_slide._x, _root["slide_no"+fIndex]._x, .5, 1, true);
    move_slide.nu.no.text = fIndex+1;
    }
    } else {

    fIndex++;
    if (dummy2._alpha == 0) {
    tn_group["tn"+0].link_group._visible = true;
    tn_group["tn"+0].link_group2._visible = true;
    tn_group["tn"+0].launch_mc._visible = true;
    }
    if (dummy._alpha == 100) {

    if (fIndex>0) {
    tn_group["tn"+0].link_group._visible = false;
    tn_group["tn"+0].link_group2._visible = false;
    tn_group["tn"+0].launch_mc._visible = false;
    }
    tn_group["tn"+0].contents.htmlText = desc_list[fIndex];
    tn_group["tn"+0].heading.text = heading_list[fIndex];
    tn_group["tn"+0].price.text = price_list[fIndex];
    tn_group["tn"+0].tn_pic.loadMovie(image_list[fIndex]);
    tn_group["tn"+0].tn_pic._alpha = 0;
    preload();
    tn_group["tn"+0].contents._y = 200;
    tn_group["tn"+0].heading._y = 200;
    tn_group["tn"+0].price._y = 200;
    tn_group["tn"+0].buy_btn._y = 200;
    tn_group["tn"+0].trial_btn._y = 200;
    tn_group["tn"+0].link_group._y = 200;
    tn_group["tn"+0].link_group2._y = 200;
    tn_group["tn"+0].launch_mc._y = 200;

    var aniM:Tween = new Tween(move_slide, "_x", Elastic.easeOut, _root.move_slide._x, _root["slide_no"+fIndex]._x, .5, 1, true);
    move_slide.nu.no.text = fIndex+1;
    }
    }
    }
    var c_menu:ContextMenu = new ContextMenu();
    c_menu.hideBuiltInItems();
    _root.menu = c_menu;
    var item:ContextMenuItem = new ContextMenuItem("Created By Favaz .B", menu);
    c_menu.customItems[0] = item;
    Noemi

  3. #3
    Moderatore di CSS L'avatar di KillerWorm
    Registrato dal
    Apr 2004
    Messaggi
    5,780
    Ciao Noemi.
    Giusto per correttezza nei confronti di chi legge questa discussione, e come da regolamento, mi sembra opportuno riportare qui il link alla pagina in cui hai ricevuto risposta da Julius riguardo il problema che hai esposto.

    http://www.juliusdesign.net/flash-ba...t-gallery-xml/
    Installa Forum HTML.it Toolset per una fruizione ottimale del Forum

  4. #4
    Utente di HTML.it
    Registrato dal
    May 2006
    Messaggi
    19
    infatti...io non sapevo se potevo scriverlo.
    Mi scuso con il grande Julius per aver postato il suo codice senza citarne l'autore:
    Comunque lo stesso Julius mi ha fatto notare che il file non va randon ma segue una sequenza ...ha solo un piccolo bug in animazione....
    E' una risorsa fantastica il blog di julius!
    Noemi

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.