Professional Web Applications Themes

Using XML to Add Links to Flash Buttons - Macromedia Flash Data Integration

I have two buttons in a flash movie. Each button links to a unique url. I want to use XML to dynamically define the urls for each of the buttons. Setting up in XML is easy. I'm using attributes. Ex showing simple xml code: <data> <url_1 link="url path" /> <url_2 link="url path" /> </data> I don't need the actionscript to declare or load XML, just the code that will attach the url links (attributes) to the buttons. I haven't seen a simple example of how to do this in my XML books or online. I'm using ActionScript 2.0....

  1. #1

    Default Using XML to Add Links to Flash Buttons

    I have two buttons in a flash movie. Each button links to a unique url. I want
    to use XML to dynamically define the urls for each of the buttons. Setting up
    in XML is easy. I'm using attributes. Ex showing simple xml code:

    <data>
    <url_1 link="url path" />
    <url_2 link="url path" />
    </data>


    I don't need the actionscript to declare or load XML, just the code that will
    attach the url links (attributes) to the buttons. I haven't seen a simple
    example of how to do this in my XML books or online.

    I'm using ActionScript 2.0.

    JSokko Guest

  2. #2

    Default Re: Using XML to Add Links to Flash Buttons

    I personally dont know of any easy way other than loading the xml file....if you want it to be dynamic......or loading it from a text file.

    ................
    ghost31379 Guest

  3. #3

    Default Re: Using XML to Add Links to Flash Buttons

    var link_xml_data:XML = new XML(
    "<data>
    <url_1 link="url path" />
    <url_2 link="url path" />
    </data>");

    var link1:String = String(link_xml_data.url_1link);
    var link1:String = String(link_xml_data.url_2link);

    I might have slight sintax errors, but this is the general idea.

    *U have to declare or load the XML somehow otherwise how would you store the
    links?


    chukcha14 Guest

  4. #4

    Default Re: Using XML to Add Links to Flash Buttons

    Oops, that was AS3 way of doing this.
    In AS2 you have the wonderful XPath API. XPath is a class that has some static
    functions that help you to do the xml parsing. Read about it in the official
    doentation. It's very straightforward.

    chukcha14 Guest

  5. #5

    Default Re: Using XML to Add Links to Flash Buttons

    Thank you so much for this information. It is very helpful.:cool;
    JSokko Guest

Similar Threads

  1. Buttons for links inside flash form
    By ghouser in forum Coldfusion Flash Integration
    Replies: 2
    Last Post: August 1st, 02:25 AM
  2. Flash Buttons
    By Adm Estrela webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 11
    Last Post: January 9th, 06:57 PM
  3. scrollable list of links/buttons
    By news in forum Macromedia Flash
    Replies: 5
    Last Post: July 20th, 05:14 PM
  4. Scrolling nav bar with buttons/links to frames
    By rareformdesignltd webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 0
    Last Post: September 16th, 01:42 PM
  5. HAVING PROBLEM WITH LINKS FLASH BUTTONS..
    By HONKEYTONKANGEL webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 4
    Last Post: July 26th, 04:40 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139