XML > Flash .. HELP PLEASE!! .. is there a way I can do thi
Does anyone know how I can achieve the following? I am getting a bit stuck to say the least!!
I have an xml document containing several nodes relating to countries. for each country in the document there is an xml <url></url> node which contains the final part of the url the user will eventually be able to click through to.
how do I extract this partial url, and append it to the getURL command on the flash button which is waiting for it.
in effect the getURL command will have an unfinished url string, which needs this final part from the xml document.
This is actually quite an easy and common problem. But first, what version of flash/actionscript are you using?
I'm assuming since you're talking about getURL(), it must be 2.0 or older.?
I love it .. an easy solution! thank goodness for that I've been tearing my hair out here!
I am building this in Flash 8 professional using AS2. I'm getting better - and the more I discover the more excited I am getting, but my knowledge of both this and XML is at best at 'novice'!
Flash actually needs to do two things with this URL info .. in no particular order, it needs to be able to append the URL to the core url already in the action script .. but it also needs to recognise there is in fact content in that url node and if empty do nothing - but if content does exists it needs to be able to tell the movieclip for that particular country to change to visible. .. the moveclip then appears with the url all ready to redirect the user to the full url.
hope that hasn't complicated the easy solution too much!
A copy of your XML and AS code would help.
Hopefully this makes sense .. please don't laugh at my feeble attempts at AS. I dare say there are lots of holes in it!
it does work with the flash file, insomuch as the pop ups work and all that. but it would be really neat if it could :
1. Only allow each country's 'content_mc' movie clip to be set to visible if the xml node <url</url> actually contains something. So if there is no content there's no 'button'.
2. Pass the content of the <url></url> into an onRelease command already containing the first part of the URL to complete the URL.
3. Pass the contents of the 'name' and 'summary' nodes into the pop up bubble_mc. They work if I put them on the main timeline, but they don't if they are within the 'bubble_mc's. I think it's down to referencing somehow .. but I'm not getting the hang of that just yet .. though I am working on it!
I'll pop the thing up to www.redhotmouse.com/euromap so you can see what I am trying to achieve.
Last edited by redhotmouse; 03-07-2009 at 12:27 PM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread