aaahhhh xml newbie going spare any help

  • 15 years ago

    hi guys, ive just joined here... Im a total newbie got hold of some free source and modified to the best of my ability but I cant get the images to load in basically i haven't got a clue as to where i would put the code to get the images to load... can anyone please help its a flash xml combo..


    the zip can be found here:
    http://raq2067.uk2.net/developer/XReg/Archive2.zip


    heres the flash code:


    // << this is where ive added script to get the pics to load


    stop();



    this.positions            = new Array();
    this.titles                = new Array();
    this.prices                = new Array();



    //this.photos        = new Array();


    this.text                = new Array();
    this.page_content        = new Array();
    this.myXML                = new XML();
    this.myXML.ignoreWhite    = true;


    this.onEnterFrame = function() {
       starty = GetProperty(root.pages,y);
       verticalno = pagesy-starty;
       setProperty (_root.pages, _y, starty+(verticalno/6));        
    }


    this.pageMove = function(location) {
       trace("location: " + location);
       _global.pagesy = location;
    }


    this.menuMove = function(x) {
       var mousePos = x;
       if (mousePos<=20) {
           // Tell menu to show itself
           root.menu.showMenu();
       } else if (mousePos>=275) {
           // Tell menu to hide itself
           
    root.menu.hideMenu();
       }
    }


    this.myXML.onLoad = function(success) {
       if (success) {
           trace("XML Loaded!");
           global.allNodes    = this.firstChild.childNodes;
           
    global.hidden        = true;
           
           trace("Total Pages: " + allNodes.length);
           j = 0;
           while (j<allNodes.length) {
               duplicateMovieClip(root.pages["page"], "page"+j, j);
               setProperty(
    root.pages["page"+j], y, j*326);
               
    root.pages["page"+j].location = -j*326;
               
               titles.push(allNodes[j].attributes.title);            
               
               prices.push(allNodes[j].attributes.price);    


       
    //            root.pages.page.imageArea = loadImage(this.photo);
               
               
               positions.push(
    root.pages["page"+j].location);
               if (allNodes[j].nodeName == "page") {
                   root.pages["page"+j].pageTitle = allNodes[j].attributes.title;
                   var linkText                    = allNodes[j].attributes.name;
                   
    root.menu.menutxt.html        = true;
                   
    root.menu.menutxt                += "<a href=\"asfunction:root.pageMove,"+positions[j]+"\">"+linkText+"</a><br>";
               }
               j++;
           }
           for (k=0; k<titles.length; k++) {
               root.pages["page"+k].title = titles[k];
           }            
           
           for (k=0; k<prices.length; k++) {
               
    root.pages["page"+k].price = prices[k];
           }            
           
           
    //        for (k=0; k<imageArea.length; k++) {
    //            _root.pages["page"+k].imageArea = photo[k];
    //        }    


           
           
           for (i=0; i<allNodes.length; i++) {
               pagecontent = allNodes.childNodes;
           }
           for (k=0; k<page
    content.length; k++) {
               for (l=0; l<pagecontent[k].length; l++) {
                   
    root.pages[l].page.contentBox.html = true;
                   if (pagecontent[k][l].nodeName == "text") {
                       
    root.pages["page"+[k]].contentBox.html    = true;
                       root.pages["page"+[k]].contentBox        = pagecontent[k][l];


                   }
               }
           }            
       } else {
           trace("XML didn't load.");    
       }
    }


    this.myXML.load("content.xml");



    // << this is wherre ive added script to get the pics to load


Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Anyone who considers arithmetic methods of producing random digits is, of course, in a state of sin.” - John von Neumann