Professional Web Applications Themes

newbie: xml data and plotting points - Macromedia Flash

I'm hoping that someone here can get me off in the right direction with this... Flash MX (not 2004) I am supplied an XML file with the following data format (via URL): <?xml version="1.0" encoding="iso-8859-1"?> <dataset> <point> <id>1</id> <name>Test Data Point</name> <description>A string - no more than 255 chras</description> <coord_x>608</coord_x> <coord_y>242</coord_y> <contents>A long string, possibly pages worth of text</contents> </point> <point> ... </point> </dataset> In the FLA file, there is a button object named "map_point" in the library. What I would like to do is load the XML data for each point, create a new instance of map_point and change ...

  1. #1

    Default newbie: xml data and plotting points

    I'm hoping that someone here can get me off in the right direction with
    this... Flash MX (not 2004)

    I am supplied an XML file with the following data format (via URL):
    <?xml version="1.0" encoding="iso-8859-1"?>
    <dataset>
    <point>
    <id>1</id>
    <name>Test Data Point</name>
    <description>A string - no more than 255 chras</description>
    <coord_x>608</coord_x>
    <coord_y>242</coord_y>
    <contents>A long string, possibly pages worth of text</contents>
    </point>
    <point>
    ...
    </point>
    </dataset>

    In the FLA file, there is a button object named "map_point" in the
    library. What I would like to do is load the XML data for each point,
    create a new instance of map_point and change it's _x and _y so it is at
    (coord_x,coord_y). (...after that is accomplished, I will be looking
    into setting other properties of the instance, but positioning is top
    priority.)

    I've found a couple posts that deal with getting the data into an array
    or the like after reading it, but I don't think I need to bother with
    that since all I want to do is modify an instance of an object...

    TIA

    --
    Justin Koivisto - [email]spamkoivi.com[/email]
    [url]http://www.koivi.com[/url]

    Justin Koivisto Guest

  2. #2

    Default Re: newbie: xml data and plotting points

    On Thu, 12 Aug 2004 22:11:44 GMT, Justin Koivisto <spamkoivi.com>
    wrote:
    >I'm hoping that someone here can get me off in the right direction with
    >this... Flash MX (not 2004)
    >
    >I am supplied an XML file with the following data format (via URL):
    ><?xml version="1.0" encoding="iso-8859-1"?>
    ><dataset>
    > <point>
    > <id>1</id>
    > <name>Test Data Point</name>
    > <description>A string - no more than 255 chras</description>
    > <coord_x>608</coord_x>
    > <coord_y>242</coord_y>
    > <contents>A long string, possibly pages worth of text</contents>
    > </point>
    > <point>
    > ...
    > </point>
    ></dataset>
    >
    >In the FLA file, there is a button object named "map_point" in the
    >library. What I would like to do is load the XML data for each point,
    >create a new instance of map_point and change it's _x and _y so it is at
    >(coord_x,coord_y). (...after that is accomplished, I will be looking
    >into setting other properties of the instance, but positioning is top
    >priority.)
    >
    >I've found a couple posts that deal with getting the data into an array
    >or the like after reading it, but I don't think I need to bother with
    >that since all I want to do is modify an instance of an object...
    >
    >TIA
    If you want to bring a XML file into Flash to work on data in it you
    have to create a new XML object, then p it. Otherwise Flash is
    blind to the data. XM 2004 has many XML functions you can use to
    search a XML doent by nodes, etc.. How many are in MX I don't know.
    Without creating the new XML object and parsing it (walking down the
    XML tree) to get the data the external file has in it, you're not
    going to get anywhere. While you don't always have to build an Array,
    it usually makes sense if you do. Its much easier to work with
    especially if the XML file is sizeable.

    XML and Flash is a hot topic right now. Here'a couple links to get you
    started.

    [url]http://www.flashdeveloper.nl/g_flash_xml_faq.html#1-C[/url]
    [url]http://www.kirupa.com/developer/actionscript/xmldataflash.htm[/url]

    In addition you can use server side scripting like CGI, Perl, PHP
    depending on how complex things get.

    Adam Albright Guest

  3. #3

    Default Re: newbie: xml data and plotting points

    Adam Albright wrote:
    > On Thu, 12 Aug 2004 22:11:44 GMT, Justin Koivisto <spamkoivi.com>
    > wrote:
    >
    >>I'm hoping that someone here can get me off in the right direction with
    >>this... Flash MX (not 2004)
    ....
    >>In the FLA file, there is a button object named "map_point" in the
    >>library. What I would like to do is load the XML data for each point,
    >>create a new instance of map_point and change it's _x and _y so it is at
    >>(coord_x,coord_y). (...after that is accomplished, I will be looking
    >>into setting other properties of the instance, but positioning is top
    >>priority.)
    >
    > If you want to bring a XML file into Flash to work on data in it you
    > have to create a new XML object, then p it. Otherwise Flash is
    > blind to the data.
    ....
    Thanks for the links. I've bookmarked for future reference. ;)
    > In addition you can use server side scripting like CGI, Perl, PHP
    > depending on how complex things get.
    I actually use PHP to generate the XML file from a mysql database -
    that's my strong point. ;)

    OK, I now am able to access the data and print it out via the trace
    function... So now the question is, "How do I create an instance of a
    symbol from the library and change it's properties?"

    My first thought was that I'd have to create and name an instance
    off-stage, then use AS to copy, rename and change properties. Is this
    what needs to be done, or can I create a new instance directly from the
    symbol's name? In either case, I don't know how I'd create the new
    instance that I want to modify.

    Any help is greatly appreciated!

    --
    Justin Koivisto - [email]spamkoivi.com[/email]
    [url]http://www.koivi.com[/url]
    Justin Koivisto Guest

  4. #4

    Default Re: newbie: xml data and plotting points

    On Fri, 13 Aug 2004 14:44:43 GMT, Justin Koivisto <spamkoivi.com>
    wrote:
    >Adam Albright wrote:
    >
    >> On Thu, 12 Aug 2004 22:11:44 GMT, Justin Koivisto <spamkoivi.com>
    >> wrote:
    >>
    >>>I'm hoping that someone here can get me off in the right direction with
    >>>this... Flash MX (not 2004)
    >
    >...
    >
    >>>In the FLA file, there is a button object named "map_point" in the
    >>>library. What I would like to do is load the XML data for each point,
    >>>create a new instance of map_point and change it's _x and _y so it is at
    >>>(coord_x,coord_y). (...after that is accomplished, I will be looking
    >>>into setting other properties of the instance, but positioning is top
    >>>priority.)
    >>
    >> If you want to bring a XML file into Flash to work on data in it you
    >> have to create a new XML object, then p it. Otherwise Flash is
    >> blind to the data.
    >
    >...
    >Thanks for the links. I've bookmarked for future reference. ;)
    >
    >> In addition you can use server side scripting like CGI, Perl, PHP
    >> depending on how complex things get.
    >
    >I actually use PHP to generate the XML file from a mysql database -
    >that's my strong point. ;)
    >
    >OK, I now am able to access the data and print it out via the trace
    >function... So now the question is, "How do I create an instance of a
    >symbol from the library and change it's properties?"
    >
    >My first thought was that I'd have to create and name an instance
    >off-stage, then use AS to copy, rename and change properties. Is this
    >what needs to be done, or can I create a new instance directly from the
    >symbol's name? In either case, I don't know how I'd create the new
    >instance that I want to modify.
    >
    >Any help is greatly appreciated!
    What you're trying to do is different then the typical use for
    bringing in data from a XML source which is most often used to grab
    some data then put it in a text field or something along those lines.
    Rather then me taking a guess and sending you off in the wrong
    direction or doing it in a clumsy way try the following forum and I
    think you'll get a faster more precise answer:

    [url]http://www.ozzu.com/privmsg.php[/url]

    On the home page about in the middle on the right side of the page is
    a selection box (Jump to) that takes you to several forums including a
    pretty active Flash one. These would be the guys to ask.



    Adam Albright Guest

  5. #5

    Default Re: newbie: xml data and plotting points

    Adam Albright wrote:
    > On Fri, 13 Aug 2004 14:44:43 GMT, Justin Koivisto <spamkoivi.com>
    > wrote:
    >
    >
    >>Adam Albright wrote:
    >>
    >>
    >>>On Thu, 12 Aug 2004 22:11:44 GMT, Justin Koivisto <spamkoivi.com>
    >>>wrote:
    >>>
    >>>
    >>>>I'm hoping that someone here can get me off in the right direction with
    >>>>this... Flash MX (not 2004)
    >>
    >>...
    >>
    >>
    >>>>In the FLA file, there is a button object named "map_point" in the
    >>>>library. What I would like to do is load the XML data for each point,
    >>>>create a new instance of map_point and change it's _x and _y so it is at
    >>>>(coord_x,coord_y). (...after that is accomplished, I will be looking
    >>>>into setting other properties of the instance, but positioning is top
    >>>>priority.)
    >>>
    >>>If you want to bring a XML file into Flash to work on data in it you
    >>>have to create a new XML object, then p it. Otherwise Flash is
    >>>blind to the data.
    >>
    >>...
    >>Thanks for the links. I've bookmarked for future reference. ;)
    >>
    >>
    >>>In addition you can use server side scripting like CGI, Perl, PHP
    >>>depending on how complex things get.
    >>
    >>I actually use PHP to generate the XML file from a mysql database -
    >>that's my strong point. ;)
    >>
    >>OK, I now am able to access the data and print it out via the trace
    >>function... So now the question is, "How do I create an instance of a
    >>symbol from the library and change it's properties?"
    >>
    >>My first thought was that I'd have to create and name an instance
    >>off-stage, then use AS to copy, rename and change properties. Is this
    >>what needs to be done, or can I create a new instance directly from the
    >>symbol's name? In either case, I don't know how I'd create the new
    >>instance that I want to modify.
    >>
    >>Any help is greatly appreciated!
    >
    >
    > What you're trying to do is different then the typical use for
    > bringing in data from a XML source which is most often used to grab
    > some data then put it in a text field or something along those lines.
    > Rather then me taking a guess and sending you off in the wrong
    > direction or doing it in a clumsy way try the following forum and I
    > think you'll get a faster more precise answer:
    >
    > [url]http://www.ozzu.com/privmsg.php[/url]
    >
    > On the home page about in the middle on the right side of the page is
    > a selection box (Jump to) that takes you to several forums including a
    > pretty active Flash one. These would be the guys to ask.
    Thanks, I'll check it out when I get a chance.

    --
    Justin Koivisto - [email]spamkoivi.com[/email]
    [url]http://www.koivi.com[/url]
    Justin Koivisto Guest

Similar Threads

  1. anchor points disappeared! newbie question
    By Sam_Spaeth@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 5
    Last Post: September 22nd, 04:58 PM
  2. display data points but not data tips
    By ahatl123 in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: April 30th, 07:17 AM
  3. Drag Data Points
    By Andriy Drozdenko in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: April 29th, 11:39 AM
  4. CFCHART problem with too many data points
    By Bill Gordon in forum Macromedia ColdFusion
    Replies: 1
    Last Post: June 6th, 10:57 PM
  5. CFCHART not showing all data points
    By csw11235 in forum Macromedia ColdFusion
    Replies: 0
    Last Post: May 9th, 05:12 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