XML and db and director

Ask a Question related to Macromedia Director Basics, Design and Development.

  1. #1

    Default XML and db and director

    Ok heres a biggi

    I have a project that requires me to work with xml.
    The requirement is to produce a director interface and hook that up to a dbase

    Has anyone used a director interface with a database and can I use xml too
    Does anyone have any experience with this

    Thank

    Patric

    brightface Guest

  2. Similar Questions and Discussions

    1. Director MX to Director MX 2004 FREE Upgrade now available
      Director MX to Director MX 2004 - English Macromedia Customers who purchased Director MX between December 6, 2003 and April 9, 2004 (dates subject...
    2. How to import a director file into director? URGENT
      Hi, I've kinda finished what i want to do and i've just realised i kinda stuffed up. i need to "combine" several director files into one. how do i...
    3. Director MX [for OS X] Get Info says its a Director 8.5 file!?!?!
      I am working on a kiosk for the http://www.arsc.edu and when I create files in Director MX and go to the finder to Get Info, it says that its a...
    4. loading director files into a director file?
      Hi I made 2 games in director and I'd like to have something like a menu to choose betweeen the 2 games so i was wondering if there was a way of...
    5. Can Director MX save a movie as a Director 8.5 file?
      Can Director MX save a movie as a Director 8.5 file? I can't find this option in "save as" or "export." HELP!
  3. #2

    Default Re: XML and db and director

    I've used xml with authorware allot and director a little. i use
    director 8.5, dunno if the xml parser is any different in mx or mx
    2004.

    here is a good refference document:
    [url]http://www.macromedia.com/support/director/internet/using_xml_parser_xtra/[/url]

    what it boils down to is you have to read in the xml file and store
    the data in some way. i make a property list from it. the parser will
    make a property list for you, but i find it's easier for me to
    understand mine than the one the parser creates. if you make any
    changes to the data you have to re-write the xml file to reflect those
    changes. here's a code snippet from a task list application i made
    that stores task data in an xml file. this is the handler that writes
    the updated xml file after data has been manipulated. the global
    variable currentXml is the property list that's created when the
    application launches and reads in the xml file.

    global currentXml

    on generateXml
    -- write header and main tag
    xmlText = "<?xml version=" & quote & "1.0" & quote & "?>" & return &
    \
    "<taskList lastModified=" & quote & the date & quote & ">" & return
    -- write task tags
    repeat with counter = 1 to currentXml.count
    thisTag = "<task taskNumber=" & quote & counter & quote & "
    createdDate=" & quote & currentXml[counter][1][2] & quote & "
    dueDate=" & quote & currentXml[counter][1][3] & quote & "
    completeDate=" & quote & currentXml[counter][1][4] & quote & ">" &
    return & tab & "<taskTitle>" & currentXml[counter][2] & "</taskTitle>"
    & return -- title tag
    -- comment tags
    if (currentXml[counter][3].count <> 0) then
    repeat with counter2 = 1 to currentXml[counter][3].count
    thisComment = tab & "<statusComment commentNumber=" & quote &
    currentXml[counter][3][counter2][1] & quote & " dateCommentAdded=" &
    quote & currentXml[counter][3][counter2][2] & quote & ">" &
    currentXml[counter][3][counter2][3] & "</statusComment>" & return
    thisTag = thisTag & thisComment
    end repeat
    end if
    thisTag = thisTag & "</task>" & return
    xmlText = xmlText & thisTag
    end repeat
    xmlText = xmlText & "</taskList>"
    -- write xml file
    xmlFileWriter = new(xtra "fileio")
    createFile(xmlFileWriter, "taskList.xml")
    openFile(xmlFileWriter, "taskList.xml", 0)
    -- clear file
    writeString(xmlFileWriter, "")
    repeat while (error(xmlFileWriter, status(xmlFileWriter)) <> "OK")
    nothing
    end repeat
    -- write new data
    writeString(xmlFileWriter, xmlText)
    repeat while (error(xmlFileWriter, status(xmlFileWriter)) <> "OK")
    nothing
    end repeat
    xmlFileWriter = 0
    return 1
    end generateXml

    the xml file it writes will look something like this:

    <?xml version="1.0"?>
    <taskList lastModified="1/19/2004">
    <task taskNumber="1" createdDate="10/17/2003" dueDate="10/22/2003"
    completeDate="0">
    <taskTitle>This is some task.</taskTitle>
    <statusComment commentNumber="1" dateCommentAdded="10/18/2003">This
    is a comment about this task.</statusComment>
    </task>
    <task taskNumber="2" createdDate="10/17/2003" dueDate="11/12/2003"
    completeDate="0">
    <taskTitle>This is another task.</taskTitle>
    <statusComment commentNumber="1" dateCommentAdded="11/09/2003">This
    is a comment about task number 2.</statusComment>
    </task>
    </taskList>
    Ex Malterra Guest

Posting Permissions

  • You may not post new threads
  • You may 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