Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Flash not reading XML

    I have a flash application that catalogs all the tv shows and places it in a nice neat location.

    This application displays it in various ways
    - such as just all by tv shows,
    - by network
    - plus other things such as movies and more.

    The original programmer quit so i am having to go through the codes and figure everything out. I was able to split off one of the views (the view you get at if you look at Network TV) to have its own flash swf, the issue is i can't get the other view to work properly.

    Check out the entire working application here:

    http://www.myeasytv.com/ondemand/

    You see when you first load it will show the most popular tv shows, then you can click the button for Network TV, Movies, ect. (i have been able to get the view for network tv and movies to work stand alone). I just cant seem to get the Most Popular view to work

    http://www.myeasytv.com/flash/tvshows.php

    I have been looking at this code all day long, and for the life of me i can't seem to get the XML to load, when i enter debug mode all it gives me is a

    "TypeError: Error #1010: A term is undefined and has no properties."


    Which tells me that it isn't loading the XML at all

    Here is part of the actual code, i can send over FLA file if you wish

    Code:
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, parseXMLforSearchPanel);
    xmlLoader.load(new URLRequest( "xml/Full_TV_Episodes.xml"));
    
    
    function parseXMLforSearchPanel(event:Event):void{
    var xml:XML = XML(event.target.data); 
    
     
    for(var j:uint = 1; j < main.length; j++){
      if(main[j].xmlLoader == event.target){main[j].xml = XML(event.target.data); main[j].xmlLoaded = true; break;}
    }
    
     
    
      
    var source:Array = new Array({});
    for(i = 0; i < main[j].xml[0].item.length(); i++){
      source.push({
         MC:new ItemHolder(),
         title:main[j].xml[0].item[i].@title,
         channel:main[j].xml[0].item[i].@channel,
         letter:main[j].xml[0].item[i].@letter,
         genre:main[j].xml[0].item[i].@genre.split("#"),
         mostPopular:main[j].xml[0].item[i].@mostPopular,
         image:absPath + main[j].xml[0].item[i].image,
         url:main[j].xml[0].item[i].url,
         urlTarget:main[j].xml[0].item[i].url.@target,
         imgLoader:new Loader()
      });
      for(var l:uint = 0; l < source[i+1].genre.length; l++){
       var genreAdded:Boolean = false;
       for(var k:uint = 0; k < genre.length; k++){
        if(genre[k] == source[i+1].genre[l]){genreAdded = true; break;}
       }
       if(!genreAdded){genre.push(source[i+1].genre[l]);}
      }
      source[i+1].imgLoader.load(new URLRequest(source[i+1].image));
      source[i+1].MC.container.addChild(source[i+1].imgLoader);
      source[i+1].MC.title = source[i+1].title;
      source[i+1].MC.url = source[i+1].url;
      source[i+1].MC.urlTarget = source[i+1].urlTarget;
      source[i+1].MC.mouseChildren = false;
      source[i+1].MC.addEventListener(MouseEvent.ROLL_OVER, newChoiceItem);
      source[i+1].MC.addEventListener(MouseEvent.CLICK, openItemUrl);
    }
    //MOST POPULAR PART
    if(main[j].xml[0].mostPopular[0] != undefined){
      if(main[j].xml[0].mostPopular[0].show[0] != undefined){
       for(var m:uint = 0; m < main[j].xml[0].mostPopular[0].show.length(); m++){
        for(i = 1; i < source.length; i++){
         if(main[j].xml[0].mostPopular[0].show[m].@title == source[i].title){
          mostPopular.push({MC:source[i].MC});
         }
        }
       }
      }
    }
    main[j].source = source;
    genre.sort(); refreshGenreMenuDropDown();
    
     
    if(firstRun && j == menuBTNselected){
      filterByMostPopular();
      firstRun = false;
    }
    
    
    }

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    What does your XML file look like? That can be what is causing the issue.
    I would rather be a lion for a day than a lamb that lives forever.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •