| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Senior Member
|
HELP with XML loading into flash
I have a project where I need to load an images into a movie clips based on urls in that is in an XML file. Code:
I keep getting this error "Error opening URL "file:///C|/Documents%20and%20Settings/Robert%20McFadden/Desktop/afc/undefined" saying my var is not defined how do i define this var? |
|
|
|
|
|
#3 (permalink) |
|
Senior Member
|
Thats the thing, I know that is a proper node, or atleast Im pretty damn sure it is. Can you please tell me if I have my XML structured properly Code:
Basically I plan on repeating the movie parent over and over to hold info on several movies. |
|
|
|
#4 (permalink) |
|
Iris Folder
Join Date: Apr 2003
Location: smokey
Posts: 2,674
|
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:
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. |
|
|
|
#7 (permalink) |
|
i still want paying
Join Date: Oct 2003
Location: newcastle, uk
Posts: 4,728
|
you can also loop through the childNodes using .length Code:
|
|
|
|
#8 (permalink) |
|
Senior Member
|
Yea, I have scene all this looping stuff, but can't understand why I would want to use it in the situation. It just seems to me that it would go thru more of the XML file then I want and I don't understand where it is putting the info. Last edited by d3mcfadden : 14-10-2005 at 12:04. |
|
|
|
#9 (permalink) |
|
Senior Member
|
what is wrong with this code??? I am trying to sort thru this array Ive created (or think Ive created) I can trace the entire array, but when I try and call a individual section of it, I get the good old UNDEFINED bullshit? Code:
basically I have two video series I want to sort them out based on their series attribute then put them into their own separate arrays |
|
|
|
#10 (permalink) |
|
Iris Folder
Join Date: Apr 2003
Location: smokey
Posts: 2,674
|
each time your looping your redefining the array. So emptying it. Define them outside the function then just push(); the entries as they appear to append them to the end of the arrays.. Code:
Of course the .push(); appends to the end of the array rather than adding it to a specific location. If that's improtant forget about the push and do it the way you were. |
|
![]() |