A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: XML Connection in my intership project

  1. #1
    High School Senior
    Join Date
    Jul 2005
    Location
    Olathe, KS
    Posts
    50

    XML Connection in my intership project

    Help,
    As part of my internship (I'm a High School Senior) I have been assigned to create an electronic bill viewer for Johnson County Wastewater (Gov't Util) and I was creating one using the XML connectors and flash. (I'm one of two people in entire office who knows Flash, other is gone, and not big in XML connectivity) The goal is that people will type their account number in the account number field (overlayed on JPEG) and it will bring up their account balance. I cannot get the data to return to the table and bring up the specified data.

    Data Flow:
    User types in number > Data sent to XML or Data Array? > Data sent to Balance Text Box


    File Attached(remotely, didn't meet size req):
    http://www.ryanmetcalf.net/flash/mini-ebill.zip

  2. #2
    High School Senior
    Join Date
    Jul 2005
    Location
    Olathe, KS
    Posts
    50
    What type of data retreival would be best for this?
    XML or SQL/MySQL
    Would XML even work?
    It doesn't actually need to send data to the database, I just need to retreive only the requested account.

  3. #3
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    To me it begs Sql, but could be that you want this to be run completely independent of a connection so if it had to be xml:

    Setup your master list of users, account numbers and balances in your backside xml and inside have the user enter an account number in the start of the movie...advance the movie and freeze that number (so user cannot edit) and retrieve your master list (xml). Bounce through the nodes and make the entire account visible if an account number attribute matches the entered (frozen) textfield value. If you time the keyframes and loop right, you could make it a seemless routine on every click.


    Or something along those lines
    Last edited by Chris_Seahorn; 08-24-2005 at 12:15 AM.

  4. #4
    High School Senior
    Join Date
    Jul 2005
    Location
    Olathe, KS
    Posts
    50
    ^^^(I think it was decided here not to directly link to the MySQL server, so I thin it is necessary to just use an XML file that would be manually updated from another machine, because the full MySQL database contains numerous amounts of personal customer data)
    I have a sucessful text field on the first page where the user enters the account number, and I created a test XML with imaginary account numbers and values.
    PHP Code:
    <customernode>
    <
    customer id="45" balance="45"/>
    <
    customer id="25" balance="125.34"/>
    </
    customernode
    I then linked the XML to the flash with an XML connector and a dataset. What I was struggling with is the ActionScript or other necessary code to link that text box to the data nodes, and what you referred to as locking it after the customer clicks next.

    http://i2.photobucket.com/albums/y13...-help-test.swf
    (I uploaded this version of the swf a while ago)
    Last edited by ryanmetcalf; 08-25-2005 at 04:33 PM.

  5. #5
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Lets say in frame 1 we halt and the user enters an account number in a textfield named "userenteredvalue". On thier click, advance the movie down the timeline, retrieve the master xml and filter through looking for an id match for the entered id.



    item.balance = mainItem[i].attributes.balance;
    item.id = mainItem[i].attributes.id;
    item.onenterframe = function() {
    if(this.id == _root.userenteredvalue){
    this._visible=true;
    }else{
    this._visible=false;
    }
    };



    Not sure what you mean. You need someone to write the whole script for the xml in flash or are just tossing ideas?

  6. #6
    High School Senior
    Join Date
    Jul 2005
    Location
    Olathe, KS
    Posts
    50
    Thanks, I'll try and work with this.

    Quote Originally Posted by Chris_Seahorn
    Not sure what you mean. You need someone to write the whole script for the xml in flash or are just tossing ideas?
    My goal is to be able to write it myself, if anyone is interested in wiritng the script, the most I could offer them is $10. Thanks for all of the help, soon I'll be trying to write in the new information and post any more questions I encounter.

  7. #7
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I think you are gonna be fine. Just setup the xml attribute you want to filter by (in the case of your match to an account id) and remember that the attributes themselves can not only be used as inbound carriers for displayed data but also for data or integers you use yourself to push to actionscript commands, if/else routines, mouseover balloons and much more that the end user never even knows about.
    Last edited by Chris_Seahorn; 08-30-2005 at 07:00 PM.

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