dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: XML url call

  1. #1
    Senior Member
    Join Date
    May 2003
    Posts
    160

    XML url call

    hi everyone,

    i'm trying to call a url from an xml file when you click a button in flash. i can't seem to get it to call the url correctly. can someone show me the correct actionscript to call the xml node, please.

    EX XML:

    <icons>
    <icon image="icon0.JPG" theURL="http://www.google.com" content="BLAH BLAH BLAH BLAH BLAH" />
    </icons>

    i tried..
    getURL(theURL, "_blank");

  2. #2
    Senior Member
    Join Date
    Apr 2006
    Posts
    1,059
    heh....where is the XML is it a seperate file or you created it in the flash code?
    in otherWords are you talking about a flash XML object or an actuall XML file somewhere?

    if its the file youll have to load it first

    myXML:XML = new XML()
    myXML.onLoad=function(){
    trace(this)
    }
    myXML.load("http://www.somewhere.com/something.xml")

    then
    myXML.firstChild.childNodes[0]

    would be
    <icon image="icon0.JPG" theURL="http://www.google.com" content="BLAH BLAH BLAH BLAH BLAH" />

    so myXML.firstChild.childNodes[0] .attributes

    would be an object
    object["image"]=="icon0.JPG"
    object["theURL"]="http://www.google.com"
    object["content"]="BLAH BLAH BLAH BLAH BLAH"

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center