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

    Menu XML caricato in un filmato

    Ciao a tutti!
    Io avrei questo problema:
    ho creato un menu editabile da file xml in un filmato.
    Se provo a caricare questo filmato(con il menu) in un altro filmato tramite loadMovie() il menu non viene più visulizzato!
    E' un problema stupido ma essendo un novizio di ActionScript e Flash Mx ho bisogno di aiuto!
    Spero soprattutto di essere stato chiaro.
    Grazie e ciao
    Dovunque si va, non si può fare a meno di incontrare persone intelligenti. È divenuta una vera peste.
    Oscar Wilde

  2. #2
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    Come carichi il menu?

  3. #3
    Il codice per il filmato del menù è :

    //-----------------------------------------------//
    sectionNames = new Array();
    sectionLinks = new Array();
    var menuSpacing = 20;
    mio_xml = new XML();
    mio_xml.path = this;
    mio_xml.ignoreWhite = true;
    mio_xml.onLoad = function(success) {
    if (success) {
    var nodes = this.firstChild.childNodes;
    for (var i = 0; i<nodes.length; i++) {
    var button_i = nodes[i].attributes.label;
    var links_i = nodes[i].attributes.link;
    sectionNames.push(button_i);
    sectionLinks.push(links_i);
    //trace(sectionNames[i]);
    }
    } else {
    //this.path.labelName = "Caricamento Errato";
    }
    sectionCount = sectionNames.length;
    for (var i = 0; i<=sectionCount; i++) {
    _root.menu.menuItem.duplicateMovieClip("menuItem_" +i, i);
    _root.menu["menuItem_"+i].labelName = sectionNames[i-1];

    _root.menu["menuItem_"+i].link = sectionLinks[i-1];

    _root.menu["menuItem_"+i]._y = spazio;
    if (i != 1) {
    _root.menu["menuItem_"+i]._y = _root.menu["menuItem_"+(i-1)]._y+_root.menu["menuItem_"+(i-1)].height+menuSpacing;
    }
    }
    };
    mio_xml.load("menu_azienda.xml");
    //------------------------------------------------------------//

    Poi lo carico nell'altro filmato con il codice solito per caricare i movie esterni:
    loadMovie("nome_filmato.swf",istanza_Movie_clip);

    Spero che fosse questo quello che volevi sapere...
    Dovunque si va, non si può fare a meno di incontrare persone intelligenti. È divenuta una vera peste.
    Oscar Wilde

  4. #4
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    ok, supponendo che il codice sia nella root del filmato esterno, cambialo con:

    codice:
    sectionNames = new Array();
    sectionLinks = new Array();
    var menuSpacing = 20;
    mio_xml = new XML();
    mio_xml.path = this;
    mio_xml.ignoreWhite = true;
    mio_xml.onLoad = function(success)
    {
    	if (success) {
    		var nodes = this.firstChild.childNodes;
    		for (var i = 0; i < nodes.length; i++) {
    			var button_i = nodes[i].attributes.label;
    			var links_i = nodes[i].attributes.link;
    			sectionNames.push(button_i);
    			sectionLinks.push(links_i);
    			//trace(sectionNames[i]); 
    		}
    	} else {
    		//this.path.labelName = "Caricamento Errato"; 
    	}
    	sectionCount = sectionNames.length;
    	for (var i = 0; i <= sectionCount; i++) {
    		this.path.menu.menuItem.duplicateMovieClip("menuItem_" + i, i);
    		this.path.menu["menuItem_" + i].labelName = sectionNames[i - 1];
    		this.path.menu["menuItem_" + i].link = sectionLinks[i - 1];
    		this.path.menu["menuItem_" + i]._y = spazio;
    		if (i != 1) {
    			this.path.menu["menuItem_" + i]._y = this.path.menu["menuItem_" + (i - 1)]._y + this.path.menu["menuItem_" + (i - 1)].height + menuSpacing;
    		}
    	}
    };
    mio_xml.load("menu_azienda.xml");

  5. #5
    Ok ora provo poi spero di non romperti più!
    Dovunque si va, non si può fare a meno di incontrare persone intelligenti. È divenuta una vera peste.
    Oscar Wilde

  6. #6
    Funziona alla grande grazie mille!
    :gren: :gren:
    Dovunque si va, non si può fare a meno di incontrare persone intelligenti. È divenuta una vera peste.
    Oscar Wilde

  7. #7

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.