Reply LinkBack Thread Tools Search this Thread
Old 17-10-2005, 13:44   #1 (permalink)
d3mcfadden
Senior Member
 
d3mcfadden's Avatar
 
Join Date: Apr 2005
Location: -
Posts: 694
Send a message via AIM to d3mcfadden
How would you action script this??

What I have is an XML file with nodes that hold all the info about certian movies for this project. There are 2 different series that each movie node could belong to, the featured series and the dave series. I am trying to create 2 arrays, by parsing the XML file and determining what series each video is in then adding it to the correct array. When I attempt to call a part of the array like this : trace(featuredSeries[0]; I get undefined. I can trace the whole array but not a specific part of it. Also considering this array is defined in a certain function, will I be able to use it throughout the project??? any help is appreciated. Thanks

Code:
//differentiate the series function sortMovies(afc_xml) { // start with the first item in the XML var movies = afc_xml.firstChild.childNodes; //trace (movies); for (var i=0; i< movies.length; i++) { // only continue if the type of this item is a squirrel if (movies[i].attributes.series == "featured") { // create variables for our elements featuredSeries = new Array(); featuredSeries[i] = movies[i]; } else if (movies[i].attributes.series == "dave") { daveSeries = new Array(); daveSeries[i] = movies [i]; } } //end of for statement } //end of function
  Reply With Quote
Old 18-10-2005, 11:55   #2 (permalink)
dan
Iris Folder
 
dan's Avatar
 
Join Date: Apr 2003
Location: smokey
Posts: 2,643
  Reply With Quote
Old 18-10-2005, 11:58   #3 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,527
Its the same person. Schizophrenia?
  Reply With Quote
Old 18-10-2005, 12:43   #4 (permalink)
d3mcfadden
Senior Member
 
d3mcfadden's Avatar
 
Join Date: Apr 2005
Location: -
Posts: 694
Send a message via AIM to d3mcfadden
dont work man. the array I am trying to build fucks up and I cant figure out why
  Reply With Quote
Old 18-10-2005, 13:09   #5 (permalink)
d3mcfadden
Senior Member
 
d3mcfadden's Avatar
 
Join Date: Apr 2005
Location: -
Posts: 694
Send a message via AIM to d3mcfadden
I figured out whats going on but still need a little guidance. What is happening is that each node is being added into the Array, regardless of rather it meets the right requirements or not, but the nodes that do not meet the requirements are just added into the array as Empty vars (therefore giving me the undefined). I need to figure out a way around this. Please give me any suggestions. I know what needs to be done, just not how to do it.
  Reply With Quote
Old 18-10-2005, 13:31   #6 (permalink)
d3mcfadden
Senior Member
 
d3mcfadden's Avatar
 
Join Date: Apr 2005
Location: -
Posts: 694
Send a message via AIM to d3mcfadden
ahhh fuck sorry about all that man, didnt notice you fixed it in the other post, thanks alot that push method worked like a charm.
  Reply With Quote
Old 18-10-2005, 14:00   #7 (permalink)
Brown
volkswagen yellow & gold
 
Brown's Avatar
 
Join Date: Apr 2003
Location: london, england.
Posts: 6,147
Quote:
Originally Posted by Stickman
Its the same person. Schizophrenia?
are you talking to us?
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8