View Single Post
Old 14-10-2005, 12:04   #4 (permalink)
dan
Iris Folder
 
dan's Avatar
 
Join Date: Apr 2003
Location: smokey
Posts: 2,649
You've got two problems

Your calling your loadmovie before your xml has loaded - so it's undefined.

You need to trigger this after the xml load has succeeded. Use a function call from within the onLoad handler...

Your in the right node but you're targeting the node itself not the url attribute.

something like

Code:
var featured_xml = new XML(); featured_xml.ignoreWhite = true; featured_xml.onLoad = function(success){ if (success) { imageIt(); trace(this); }else{ trace("Error loading XML file"); // no success? trace error (wont be seen on web) }; }; // load featured_xml.load("xml/fMovies.xml"); imageIt = function () { var featuredMovie = featured_xml.firstChild.childNodes; trace(featuredMovie); featured_mc.loadMovie(featuredMovie[0].attributes.url); };

When writing things like this always use traces to see where you actually are in the node tree, it's hard to imagine sometimes.

Remember trace(); is your friend. Use it. LOTS.
  Reply With Quote