A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: I know Nothing Help Me Please :D

  1. #1
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976

    I know Nothing Help Me Please :D

    Exactly what the topic say's is how much i know about xml and flash. What i want to do is to be able to add an online edge do my game. What i need is for users to be able to register their unique nick name and password to a database and then once registered be able to change atribute's which are set in the game.

    for example.

    If the user is logged in as = "hooligan";
    that means the database will send to the flash movie the details of the character.

    health = 10;
    exp = 15;
    magic = 20;
    hunger = 12;

    and so on. And while in the game if the user wish's to save all they need to do is click save and then it will update the characteristics in the database.

    I have never tried or even know much about databases and servers or even on how to set a server up and run one. But i am really eager to learn. I have a few books on xml which taught me the specifics of writing xml documents but i dont know how to use xml documents in flash.

    I was refered to use xml when it comes to registering user details and anything online in flash.

    I guess the first thing i should learn is how to set up a server and then set up a user register screen.

    Please help


    Thanks in AdvancE
    Last edited by hooligan2001; 04-09-2003 at 11:01 PM.

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    OK, for flash and XML there are a bunch of tutorials around etc. I would suggest you have a read through the Flash-XML FAQ (link in my sig) and have a look at the tutorials etc in that.

    As for learning the database stuff find a scripting language you like (I prefer PHP but you may have a preference) and then look at documentation/tutorials etc on how to interact with databases. The difference between outputting XML and HTML is minor from a scripting point of view, as most scripting languages don't really care what you actually output.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  3. #3
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Thanks for that mr.tupps what are my choice's of the scripting language. And is the language used to set up the database?

  4. #4
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Well database scripting is nearly univesally done in SQL. If you have a windows host then you could use Access but I would never recommend that to anyone (except maybe worst enemy).

    As for your scripting language, this depends a bit on your hosting environment. One of the reasons I use PHP is that it runs pretty much the same on Windows and Linux/*BSD/MacOSX/Other Unix boxes out their (the unix derivatives are compiled from the same source and don't need any porting). Other options:

    ASP: Windows and IIS only.
    JSP: Java hosts, variety of commercial and open source software supported. JSP has different server builders
    Java Servlets: Often JSP is integrated into a Java Servlet engine. Tomcat springs to mind.
    PHP: Any and everything, personal fav.
    Perl: A bit old school but there is a lot of great information about writing scripts (check out CPAN)
    ColdFusion: Macromedia Solution, runs on multiple server platforms. However if you are getting this hosted check to make sure that ColdFusion is supported.

    There are a bunch of others, out their and I can guarentee that I have forgotten someones favourite scripting environment. Choose what works for you, and even better if you can get hold of people who can give you a hand choose whatever they are using. Having a bit of help along the way is probably the most important factor.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  5. #5
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Since you insist on PHP as your xmost favorite. I guess PHP is the way to go for me. Since its so versitile i guess it's probally the better option Do you know of any good PHP refrence sites and reccomended tutorials for PHP. And do you reccomend a book ? For xml and FLash and also PHP?

    ThankS in AdvancE

  6. #6
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    There are heaps of books on PHP, and most of them are OK, as with most things have a look at Amazon and see what the reviews are of the books before you buy them.

    As for web sites, www.php.net (home of php) is fantastic. The best bit is the manual http://www.php.net/manual/en/. People can annotate information about each function, giving you tips and advice.

    As for other sites: http://www.php.net/links.php

    Personally I have used phpbuilder.com and found it to be a very well written site.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  7. #7
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Thanks for all the help tupps. Ill go do a few tuts and get a small understanding of it all then ill be back with more specific questions

    ThankS Again i really appretiate it

  8. #8
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Ok i have read a few sections in my books and a few article's on the net and i am starting to get the gist of it. Now i am just mucking around with reading xml data.

    Now here where i need help

    Here's what my XML looks like.
    Code:
    <userList>
      <user>
        <name>hooligan</name>
        <password>12345</password>
        <age>20</age>
      </user>
      <user>
        <name>tupps</name>
        <password>67891</password>
        <age>25</age>
    </userList>
    what i want to know is how to set varibles in flash as the text node's. Just say i want the varible tupps age to be equal to
    Code:
    <userList>
      <user>
        <age>25</age>
    what code would i have to make age a sibling of name ? So it would look like this

    Code:
    <userList>
      <user>
        <name> tupps </name>
          <age>25 </age>
    ThankS in AdvancE

    [h]ooligan
    Last edited by hooligan2001; 04-13-2003 at 12:48 AM.

  9. #9
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    I edited it so that you can actually see my xml make's more sense now

  10. #10
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Ow another question. Just say i have 100 user's registered and every time a user reistered it added the following to the xml userList.

    Code:
    <userList>
      <user>
        <name>hooligan</name>
        <password>12345</password>
        <age>20</age>
        <health>97</health>
        <exp>1200</exp>
      </user>
    </userList>
    So it adds the user's
    name, password , age , health , exp and so on. Now if their where 100 user's that would mean times the following code by 100 and thats the size of the xml document. Now so when someone logs on they have to download their status and so on. But flash cant use use xml documents till the whole document is downloaded. Which mean the user has to download the whole entire xml doc with everyones info and if the userList exceedes 1000 + user's what will happen. What would be a smarter way to set this up. Any .fla files would be appretiated.

  11. #11
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    With the Age being made a child node of the user node, flash has to handy routines:

    createElement

    and

    AppendChild

    So if you had the node you wanted to append to, and you had created a new element with CreateElement (it has all the features of an XML document) you then append it with appendChild and it becomes a childNode of the element.

    As for your XML document with thousands of records, what you should do is pass the username to the server and then get the server to just look that record out of the database and send it back to you. This will make your database, server, and client all run quicker.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  12. #12
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Thanks for that tupps really appretiate it.
    would you be able to show me the syntax for
    createElement

    and

    AppendChild


    ThankS in AdvancE
    [h]ooligan

  13. #13
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Hey i wouldnt need a socket server for a varible game would i ? I mean all they need to do is save their varibles to a xml document and then load them into their game ?

  14. #14
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Hey i think i am going about this the worng way. Can you set up a html page to register users into a database or xml document. Without running a server ?

    What i want is a Html Page with

    Nick:
    Password:
    Retype Pass:
    Email:

    and a submit button. And i want when the submit button is pressed i want the page to check if the user name exists if not then check if the pasword and retype password feild match and if all is good write to the userList.xml document. Can this be done without a server ?

    In the form
    Code:
    <user>
      <nick> "name" </nick>
      <password> "12345" </password>
     <email> email@email.com </email>
    </user>
    can anyone help Please.

    ThankS in AdvancE
    Last edited by hooligan2001; 04-16-2003 at 01:30 AM.

  15. #15
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Unfortunately you will need a server to receive XML files from Flash.
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  16. #16
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    /me thought so

    So whats a good reccomendation on a server if i choose to host it myself keeping in mind different prices ranges and if it worth it. Or just choose an isp that will let me install my own server

    Sorry if im annoying you tupps its just that i need to know all this to finish my current project

  17. #17
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Well if you don't need a socket server there are a number of companies that will host your site. I have seen places that offer host at less than $5 US per month. After that you can spend any amount you wish (size of wallet is a limiting factor).

    The main thing to watch for is the bandwidth caps, and what environment that run on. Typically you have a choice of Linux/FreeBSD/OtherUnix with Apache, PHP and MySQL (possibly Java as well) or Windows IIS, and ASP (again Java a possibility).

    Hosting it yourself is an option but a decent account can be had for around $10 a month US. I use LinuxWebHost, they have reasonably quick servers, a bunch of email accounts and allow 3.5 gb to be transfered from your account each month for $10.95. Everything is automated and controlled from a control panel so even if you don't know squat about linux it is still more than usable. I would happily pay $10 a month just so I didn't have to worry about the constant stream of updates and patches that need to be applied to any web server.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  18. #18
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Thanks tupps. I have decided that i will have to edit the engine of the game a fair bit to coinside with the back end technology. Thanks heaps for you help.

    [h]ooligan

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