dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Basics of an XML Parser ?!

  1. #1
    Junior Member
    Join Date
    Sep 2001
    Posts
    8
    Hi all!

    I want to make an "Flashpainter"-alike Flashmovie (swf).

    Someone paints an Image and while he is painting, the Positions of his cursor (x,y) was stored/saved into an array! Now i wanna send/save this Data/Positions/Variables into an XML-Document on the Serverwith PHP (think its the easiest way).

    What .php Script do I have to write for parsing the x,y-Data from Flash->PHP and later for getting this Variables from the XML-Document into Flash back???!!!

    I think Im the happiest Junior-Actionscripter in the world, if someone helps me with the Backend/PHP-Scripting - cause i read so much Tutorials and nothings workin!

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    The first thing to do is to decide how you're going to format everything in your XML document.

    Then.. the easiest way to create an XML document is string concatenation(sp?) and writing the file. I'd think heavily about how to recurse through the creation of nodes, to save code.. but again - it's all how you want to do it..

  3. #3
    Junior Member
    Join Date
    Sep 2001
    Posts
    8

    Post RE:

    What do you exactly mean with nodes?

    Here is a little example, how my variables will be send from Flash:
    Code:
    //the Original was in an XML-Format-Standard//
    scratch posx="-16.2" posy="44.55"
    scratch posx="-5.39999999999998" posy="16.2"
    scratch posx="232.85" posy="6.75"
    scratch posx="-51.3" posy="-21.6"
    scratch posx="-135.65" posy="-14.15"
    scratch posx="-137.7" posy="6.75"
    The most important question for me is, how to save the variables on the Server via PHP (the script!?)/ how to save them into an XML-file so that i can load them back into Flash!?

    There are many Tutorials...but everyone forgot the Backend-Programming/PHP...noone wants to talk about, cause everyone make his own thing!?

    Please help, cause I think for the most Programmers its a thing of about 1 hour work.

    OK, thanks and waitin for reply.

  4. #4
    Junior Member
    Join Date
    Feb 2001
    Posts
    17

    Re: RE:

    Why use xml? Just send the array to the php script and the php script will store them in a text file which flash can load and create the image with.

  5. #5
    Junior Member
    Join Date
    Sep 2001
    Posts
    8

    Question RE: send Array...

    OK, I try! I think XML is better for more different Variables and stuff like that...

    If youve got a PHP-Script for saving those Variables, please post it or send me via mail!?

    Thanks, Micha.

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