A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: XML in Flash

  1. #1
    Eternally Junior Member
    Join Date
    May 2002
    Posts
    23

    XML in Flash

    I've just been reading about tree objects and the importing of sample XML schema in MX 2004 Professional, could any Flash XML users out there confirm for me the usefulness of MX 2004 Professional's support for XML.

    I'm relatively new to XML, and the form in which the XML loads into Flash MX (which I'm still using) seems pretty raw - I'm about to embark on a project using XML (in Flash MX), where I have found no reference to XML schema and the like. Is it there and I've missed it - or is it time to upgrade? Any advice anyone?

  2. #2
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    I have been using XML for a long time on Flash MX, and still now with MX 2004 Professional.
    Maybe I haven't understood the new features, but from what I know nothing has changed.

    I love the XML actionscript instruments, Flash is a great XML parser.
    Maybe the MX 2004 Professional has new component features for XML, but I do not use components, so I can't tell you about that.

    Hope this helps.
    Altruism does not exist. Sustainability must be made profitable.

  3. #3
    Eternally Junior Member
    Join Date
    May 2002
    Posts
    23
    Thanks keyone - it's not the reply I expected though. I tend to build and code from scratch myself, rather than using components and 'normal' mode, but I expected the XML in MX to arrive in a more usable format rather than having to strip out the useful bits myself. I'm not being lazy, I'm talking from a labour saving point of view.

    I'd still be interested to hear from anyone who has used the new features if they're out there.

  4. #4
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    But wait a minute...
    are we talking about the same thing?
    Did you have a look at the Actionscript Dictionary at the "XML Object" and "XMLNode Object" elements?

    Do you currently use all the XML features (like childNodes, attributes, nextSibling, appendChild etc...).
    I don't think this can be any less than with other languages, just take a look at how PHP, HTML etc.. handle XML data.

    Cheers!
    Altruism does not exist. Sustainability must be made profitable.

  5. #5
    Eternally Junior Member
    Join Date
    May 2002
    Posts
    23
    I'm gradually using more as it becomes useful to me, but mainly firstChild, childNodes, attributes and a couple of other properties. So I'm familiar with the XML object in order to use these, but I can find no reference to the XMLNode object in the dictionary. Is that something new? Perhaps it's not in the version of MX I'm using, it's an educational version.

    I read about the importing of sample XML schema in MX 2004 Professional, this might be useful to me as I'm using an predefined XML schema (QTI) which I have to get familiar with as well as working with XML in Flash. And I've come across references to the tree object which does not feature in my version of MX.

  6. #6
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    Well, using XML is all about getting usefulness from the XML parser.
    The schema you use doesn't change the workflow (as to for programming time), it's just about how logically you did it.
    The word "schema" in Flash has appeared in Flash MX 2004 professional, as you have a schema viewer in the component properties panel (this is a feature I don't really know, as I don't use components, but from what I can see it could be very useful to keep track of your data transfer logics, or even more if you want to learn how data you are using is structures ex: if you are connecting to a WebService).
    It is true that Flash MX 2004 Professional has a bunch of new components build to make data connections easier for designers.

    I still find it easier doing things myself.

    Cheers!

    p.s.
    What I was talking about with XMLNode() is a node constructor.
    Let me explain:
    If you load or create a FULL XML document, you can use the XML() object. BUT if you want to create a new node, that you want to append to the previously created XML document, you can not use the XML() object, as this will produce weird effects:
    The document will be correct, so if you then send it to a server-side script and store it to text or database everything will work well BUT Flash is not going to correctly read and interact with the XML document itself, unless you save it and reload it from scratch.

    If you create the string of your new node and create an XMLNode from it with the XMLNode constructor, then you can append the node to the previous XML document, and everything will work well in realtime, so you don't have to save and re-load the entire document.
    Altruism does not exist. Sustainability must be made profitable.

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