might be a problem with the URL.
1. Make sure that the ../xml folder is in the WWW folder of ur server, not
above it.

or

2. Try doing this:

var urlString:String = _root._url;
urlString = urlString.substr(0,urlString.lastIndexOf("/"));
urlString = urlString.substr(0,urlString.lastIndexOf("/") + 1);
urlString = urlString.concat("xml/menu.xml")
menuInfoXML = urlString;

If it works, you may want to refactor all the statements above and make the
code optimal.

~Arul Prasad.

I've just elaborated in soo many statements, just in case you dont
understand.

On 8/1/06, Jose Maria Barros <[EMAIL PROTECTED]> wrote:

can anyone help me?

On 7/31/06, Jose Maria Barros <[EMAIL PROTECTED]> wrote:
>
> i singed too soon...when i test locally everything works great...but
when
> i try it in internet..it doesnt..he doestn load the xml file....
>
> why...?
>
> The code is the same...but i did alter the url..like you said..:
>
> //EDIT XML PATH
> menuInfoXML = "./xml/menu.xml";
> // DO NOT EDIT BELOW..
>
> System.useCodepage = true;
>
> import mx.xpath.XPathAPI;
> var infoHolder:XML = new XML();
> infoHolder.load(menuInfoXML);
> infoHolder.ignoreWhite = true;
> var titlePath:String = "/root";
> //main menu array.
> var mainMenus:Array;
> //sub menu array.
> var subMenus:Array;
>
> infoHolder.onLoad = function(ok) {
>     if (ok) {
>         mainMenus = mx.xpath.XPathAPI.selectNodeList(
infoHolder.firstChild,
> titlePath+"/menu");
>         createTreeMenu();
>     }
> };
>
>
> MovieClip.prototype.getPos = function(target:Number) {
>     this.onEnterFrame = function() {
>         this._y -= (this._y-target)/6;
>         if (Math.abs(this._y-target)<0.3) {
>             delete this.onEnterFrame;
>             _root.newsMC.showNews.appear();
>         }
>     };
> };
>
>
> function createTreeMenu():Void {
>     for (i=0; i<mainMenus.length; i++) {
>         newBut = _root.conteudos_mc.portfolio_mc.attachMovie("but",
> "but"+i, 9999999+i);
>
>         newBut.arrow._alpha = 0;
>         newBut.shine._alpha = 0;
>         newBut._x = 18;
>         newBut._y = 93+(newBut._height+5)*i;
>
>         newBut.txt.text = mainMenus[i].attributes.txt;
>         newBut.link2 = mainMenus[i].attributes.url;
>         newBut.submenuCnt = mainMenus[i].childNodes.length;
>         newBut.y = newBut._y;
>         newBut.onRollOver = function() {
>             _root.conteudos_mc.portfolio_mc.tween(this, 16, 18);
>
>             this.arrow.appear();
>             this.shine.appear();
>             var textCol = new Color(this.txt);
>             textCol.setRGB(0xffffff);
>
>         };
>         newBut.onRollOut = function() {
>             _root.conteudos_mc.portfolio_mc.tween(this, 18, 16);
>
>             this.arrow.disappear();
>             this.shine.disappear();
>             var textCol = new Color(this.txt);
>             textCol.setRGB(0x6F6A63);
>         };
>         newBut.onRelease = function() {
>             if (this.submenuCnt>0) {
>                 var butNum:Number = new Number(this._name.substr(3, 1));
>                 this.createSubMenu(butNum);
>                 for (i=0; i<mainMenus.length; i++) {
>                     if (i<butNum+1) {
>
>
_root.conteudos_mc.portfolio_mc["but"+i].getPos(_root.conteudos_mc.portfolio_mc["but"+i].y);
>
>                     } else {
>
>
_root.conteudos_mc.portfolio_mc["but"+i].getPos(_root.conteudos_mc.portfolio_mc["but"+i].y+this.submenuCnt*22);
>
>                     }
>                 }
>             }
>             else {
>                 _root.conteudos_mc.portfolio_mc.clearSubMenus();
>                 for (i=0; i<mainMenus.length; i++) {
>
>
_root.conteudos_mc.portfolio_mc["but"+i].getPos(_root.conteudos_mc.portfolio_mc["but"+i].y);
>
>                 }
>                 //getURL(this.link);
>
>             }
>         };
>     }
> }
>
>
> MovieClip.prototype.createSubMenu =
function(buttonNumber:Number):Void  {
>     clearSubMenus();
>     subMenus = mx.xpath.XPathAPI.selectNodeList(mainMenus[buttonNumber],
> "/menu/submenu");
>     var butNum:Number = new Number(this._name.substr(3, 1));
>     for (i=0; i<subMenus.length; i++) {
>         subBut = _root.conteudos_mc.portfolio_mc.attachMovie("submenu",
> "subMenu"+i, Math.random()*999999);
>
>         subBut._alpha = 0;
>         subBut._x -= i;
>         subAppear(subBut, (i+3), 30);
>
>         subBut._y = this.y+this._height+(subBut._height+5)*i;
>         subBut.txt.text = subMenus[i].attributes.txt;
>         subBut.link2 = subMenus[i].attributes.url;
>         subBut.but.onRollOver = function(){
>             var textSubCol = new Color(this._parent.txt);
>             textSubCol.setRGB(0xffffff);
>         }
>         subBut.but.onRollOut = function(){
>             var textSubCol = new Color(this._parent.txt);
>             textSubCol.setRGB(0x6F6A63);
>         }
>         subBut.but.onRelease = function() {
>             loadMovie(this._parent.link2,
"_root.conteudos_mc.vazio4_mc");
>
>             trace(this._parent.link2);
>
>         };
>     }
> };
>
>
> function clearSubMenus() {
>     for (k=0; k<subMenus.length; k++) {
>         _root.conteudos_mc.portfolio_mc["subMenu"+k].removeMovieClip();
>
>     }
> }
>
>
> function clearAllMenus() {
>     for (i=0; i<mainMenus.length; i++) {
>         _root.conteudos_mc.portfolio_mc["but"+i].removeMovieClip();
>     }
> }
>
>
> Thanks...once again..xml drives me nuts..
>
>
>
>
>
> On 7/31/06, Jose Maria Barros <[EMAIL PROTECTED]> wrote:
> >
> > Oh man....thank you so much..i was getting so frustrated...well..i am
> > ...but at least..the problem is solved..
> >
> >
> >
> > On 7/31/06, eric dolecki < [EMAIL PROTECTED]> wrote:
> > >
> > > You are attaching everything to the _root, so you need to clean up
the
> > > clips
> > > one by one, unless you decide to better nest your menu & submenu
items
> > > in
> > > one movieclip. You could then remove it much easier, etc.
> > >
> > > On 7/31/06, Jose Maria Barros < [EMAIL PROTECTED]> wrote:
> > > >
> > > > Hello, i have a xml menu and when i go to other frame my menu
doenst
> > > > unload...
> > > > i tried with the functions clearMenu and clearSubMenu but they
dont
> > > > work..please help..i will send the code:
> > > >
> > > >
> > > >
> > > > import mx.xpath.XPathAPI;
> > > > var infoHolder:XML = new XML();
> > > > infoHolder.load(menuInfoXML);
> > > > infoHolder.ignoreWhite = true;
> > > > var titlePath:String = "/root";
> > > > //main menu array.
> > > > var mainMenus:Array;
> > > > //sub menu array.
> > > > var subMenus:Array;
> > > >
> > > >
> > > > //load the xml with xpath
> > > > infoHolder.onLoad = function(ok) {
> > > >     if (ok) {
> > > >         mainMenus = mx.xpath.XPathAPI.selectNodeList(
> > > infoHolder.firstChild
> > > > ,
> > > > titlePath+"/menu");
> > > >         createTreeMenu();
> > > >     }
> > > > };
> > > >
> > > >
> > > > MovieClip.prototype.getPos = function(target:Number) {
> > > >     this.onEnterFrame = function() {
> > > >         this._y -= (this._y-target)/6;
> > > >         if (Math.abs(this._y-target)< 0.3) {
> > > >             delete this.onEnterFrame;
> > > >             _root.newsMC.showNews.appear();
> > > >         }
> > > >     };
> > > > };
> > > >
> > > >
> > > > function createTreeMenu():Void {
> > > >     for (i=0; i< mainMenus.length; i++) {
> > > >         newBut = _root.attachMovie("but", "but"+i, 9999999+i);
> > > >         newBut.arrow._alpha = 0;
> > > >         newBut.shine._alpha = 0;
> > > >         newBut._x = 105;
> > > >         newBut._y = 180+(newBut._height+5)*i;
> > > >         newBut.txt.text = mainMenus[i].attributes.txt;
> > > >         newBut.link2 = mainMenus[i].attributes.url;
> > > >         newBut.submenuCnt = mainMenus[i].childNodes.length;
> > > >         newBut.y = newBut._y;
> > > >         newBut.onRollOver = function() {
> > > >             _root.tween(this, 10, 13);
> > > >             this.arrow.appear();
> > > >             this.shine.appear();
> > > >             var textCol = new Color( this.txt);
> > > >             textCol.setRGB(0xffffff);
> > > >
> > > >         };
> > > >         newBut.onRollOut = function() {
> > > >             _root.tween(this, 15, 10);
> > > >             this.arrow.disappear();
> > > >             this.shine.disappear();
> > > >             var textCol = new Color(this.txt);
> > > >             textCol.setRGB(0x6F6A63);
> > > >         };
> > > >         newBut.onRelease = function() {
> > > >             if ( this.submenuCnt>0) {
> > > >                 var butNum:Number = new
Number(this._name.substr(3,
> > > 1));
> > > >                 this.createSubMenu(butNum);
> > > >                 for (i=0; i<mainMenus.length; i++) {
> > > >                     if (i<butNum+1) {
> > > >                         _root["but"+i].getPos(_root["but"+i].y);
> > > >                     } else {
> > > >
> > > > _root["but"+i].getPos(_root["but"+i].y+this.submenuCnt*22);
> > > >                     }
> > > >                 }
> > > >             }
> > > >             else {
> > > >                 _root.conteudos_mc.portfolio_mc.clearSubMenus();
> > > >                 for (i=0; i<mainMenus.length ; i++) {
> > > >                     _root["but"+i].getPos(_root["but"+i].y);
> > > >                 }
> > > >
> > > >             }
> > > >         };
> > > >     }
> > > > }
> > > >
> > > >
> > > > MovieClip.prototype.createSubMenu =
> > > function(buttonNumber:Number):Void  {
> > > >     clearSubMenus();
> > > >     subMenus = mx.xpath.XPathAPI.selectNodeList
> > > (mainMenus[buttonNumber],
> > > > "/menu/submenu");
> > > >     var butNum:Number = new Number(this._name.substr(3, 1));
> > > >     for (i=0; i<subMenus.length; i++) {
> > > >         subBut = _root.attachMovie("submenu", "subMenu"+i,
> > > Math.random
> > > > ()*999999);
> > > >         subBut._alpha = 0;
> > > >         subBut._x -= i;
> > > >         subAppear(subBut, (i+3), 130);
> > > >         subBut._y = this.y+this._height+(subBut._height+5)*i;
> > > >         subBut.txt.text = subMenus[i].attributes.txt;
> > > >         subBut.link2 = subMenus[i].attributes.url;
> > > >         subBut.but.onRollOver = function(){
> > > >             var textSubCol = new Color(this._parent.txt);
> > > >             textSubCol.setRGB(0xffffff);
> > > >         }
> > > >         subBut.but.onRollOut = function(){
> > > >             var textSubCol = new Color(this._parent.txt);
> > > >             textSubCol.setRGB(0x6F6A63);
> > > >         }
> > > >         subBut.but.onRelease = function() {
> > > >             loadMovie(this._parent.link2,
> > > "_root.conteudos_mc.vazio4_mc");
> > > > //this doesnt disapear either...
> > > >             //trace(this._parent);
> > > >         };
> > > >     }
> > > > };
> > > >
> > > >
> > > >
> > > > function clearSubMenus() {
> > > >     for (k=0; k<subMenus.length; k++) {
> > > >         _root["subMenu"+k].removeMovieClip();
> > > >     }
> > > > }
> > > >
> > > > function clearAllMenus() {
> > > >     for (i=0; i<mainMenus.length; i++) {
> > > >         _root["but"+i].removeMovieClip();
> > > >     }
> > > > }
> > > >
> > > >
> > > > Sorry..but im really desperate with this...i tried with
unloadMovie,
> > > and
> > > > ...nothing happens...


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to