Welcome, Guest
  • Author Topic: Loadmovie uses Previous XML when New Swf Loads  (Read 1669 times)

    jonra

    • Server what's that
    • *
    • Posts: 25
      • View Profile
      • Email
    Hello Guys, I only ask when I in die'er need, I know you guys are busy, things have been going good, havn't needed any help in acouple years or so, but I do now. You guys have always save the day for me, and again if you ever need anything, I love to help you guys out in any way I can.

    I am using a AS2/XML content window from a Advanced XML site. I've been using this in the main page to open the content xml windows:

    loadMovie ("content/content.swf", "myContainer");

    but_photo.onRelease=function(){
    loadMovie ("content1/content1.swf", "myContainer");
    }
    but_band.onRelease=function(){
    loadMovie ("content2/content2.swf", "myContainer");
    }
    stop();

    When Viewing the site-
    "but_photo" is the Blue Button----"
    "but-band" is the Green Button----"

    All 3 are the same Content Window swf, it loads the new content window.swf, but can't load the proper XML. I put a preloader in the begining of other swf's, it begins to load it, but then pulls up the previous XML or the one that is loaded in the begining. I can not get the content window to load different xml's, it keeps pulling that original xml.

    I did my best to reference all help out there for past 2 days and still can't figure it out. Most of the site is based on the content window. Any help would be most appreaciated. Thanks for your time, Jonra

    My Testsite:
    www.tuff-turf.com/midwest

    AS2- XML code

    };
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    // Load default XML if no XML defined in index.xml
    if (_root.toLoad == undefined) {
            _root.toLoad = "content1/content1.xml";
    }
    xmlData.load(_root.toLoad);
    stop();

    I'm not using the index.xml, just the content window swf part of the site.
    Jonra

    Homepage or Main Swf Script -------------------------------------------------------------------------------------------------------
    #include "fullScreen_picture.as"

    Content Window AS2 script------------------------------------------------------------------------------------------------------------------------

    //
    // LOAD XML
    //
    loadXML = function (loaded) {
            if (loaded) {
                    xmlNode = this.firstChild;
                    contentBorder = Number(xmlNode.childNodes[0].attributes.Border);
                    contentWidth = Number(xmlNode.childNodes[0].attributes.Width);
                    contentHeight = Number(xmlNode.childNodes[0].attributes.Height);
                    txt_mc.txt.htmlText = xmlNode.childNodes[0].firstChild.nodeValue;
                    headerName.text = xmlNode.attributes.Name;
                    setContents();
            } else {
                    trace("Error loading XML");
            }
    };
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    // Load default XML if no XML defined in index.xml
    if (_root.toLoad == undefined) {
            _root.toLoad = "content1/content1..xml";
    }
    xmlData.load(_root.toLoad);
    stop();
    « Last Edit: 12/20/10, 15:58 by jonra »

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Loadmovie uses Previous XML when New Swf Loads
    « Reply #1 on: 12/21/10, 09:36 »
    I cannot see, where you are changing the filename?
    I suppose, the xml load command is inside of the loded swf - right?
    How do you pass the parameter for the xml-filename?
    happy flashing
    8)
    Ronald

    jonra

    • Server what's that
    • *
    • Posts: 25
      • View Profile
      • Email
    Re: Loadmovie uses Previous XML when New Swf Loads
    « Reply #2 on: 12/21/10, 18:49 »
    Hey Ronald, thanks for your help.

    This calls up the XML content1.xml inside the swf. content1.swf
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    // Load default XML if no XML defined in index.xml
    if (_root.toLoad == undefined) {
            _root.toLoad = "content1/content1..xml";
    }
    xmlData.load(_root.toLoad);
    stop();

    Each Content.swf is the Content Window with the scrollbar with the "xmlData.load" listed above inside each of the swfs.
    Each swf by itself works great. Which ever swf I load 1st, is the XML that is used everytime I loadmovie into the container. It keeps using that original XML for each new Content Window.

    So I have a homepage.swf, with blank area with the "myContainer" in the middle.
    You open the homepage.swf and it does this:

    loadMovie ("content/content.swf", "myContainer");

    but_photo.onRelease=function(){
    loadMovie ("content1/content1.swf", "myContainer");
    }
    but_band.onRelease=function(){
    loadMovie ("content2/content2.swf", "myContainer");
    }
    stop()

    But everytime you try to load content window .swf, it keeps using that original XML from the first content window that was loaded. I used the loadMovie to run all kinds of swf's, works great, even ones that use XML. Its this content window that uses similar xml's that giving me BIG problems. And basically this Content Window is used for almost every link on the site.

    Thanks so much for your help Ronald, please let me know whatever you need.
    Jonra


    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Loadmovie uses Previous XML when New Swf Loads
    « Reply #3 on: 12/22/10, 02:51 »
    did you try to run Charles for controlling the traffic?
    Maybe charles can enlight something.
    happy flashing
    8)
    Ronald

    jonra

    • Server what's that
    • *
    • Posts: 25
      • View Profile
      • Email
    Re: Loadmovie uses Previous XML when New Swf Loads
    « Reply #4 on: 01/06/11, 02:49 »
    Hey Ronald, thanks again for your help, I ended up getting everything working. Took about a week or so, but finally sorted it out. Thought you might be interested.

    This was the first fix.

    };
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("content.xml");
    stop();

    INSTEAD OF:

    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    // Load default XML if no XML defined in index.xml
    if (_root.toLoad == undefined) {
            _root.toLoad = "content1/content1..xml";
    }
    xmlData.load(_root.toLoad);
    stop();

    WORKS GET!!!!

    ALSO:


    on(release) {
       loadMovie("enlarge.swf",_root.myContainer);
    }

    INSTEAD OF

    but_enlarge.onRelease=function(){
    loadMovie ("enlarge.swf", "myContainer");
    }

    The little things make the biggest deals in action script. Its truly amazing once you figure everything out, I've learned a ton on this one. Have a great 2011!

    The sample test site is here if you'd like to take a look. Left navigation and upper left nav links are functional, still working on the right. Site's background resizes to window, navigations align up, left, bottom and right. Kinda cool. Njoy  and Thanks again, Jonra

    www.tuff-turf.com/midwest2



    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Loadmovie uses Previous XML when New Swf Loads
    « Reply #5 on: 01/06/11, 04:05 »
    good job!
     ;D

    It was a pleasure helping on this.
    Thank you for the feedback.
    happy flashing
    8)
    Ronald