A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Flash and SQL Server

  1. #1
    Member
    Join Date
    Nov 2008
    Posts
    52

    Flash and SQL Server

    Hi guys!
    I'm wondering how would I use Flash AS3.0 to connect to SQL Server and read from a table in a data base into a string or an array for use within flash.
    Thank you!

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You mean "MYSQL"?
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Member
    Join Date
    Nov 2008
    Posts
    52
    No, actually I mean SQL Server... as in Microsoft SQL Server 2005...

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Thread moved to "Scripting and Backend".
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    Typically you won't interface with the database directly. It is possible with AS3 now, but I don't know if there is a class written for SQL server. I know there is one for MySQL out there somewhere.

    You should write a server-side script to do the database work, and have it spit back XML for you to digest in Flash. If you're on a Microsoft server, you're probably in a .NET environment. .NET and SQL is not in my expertise at all, so I can't point you in any further direction. I tend to use as many open source technologies as possible.

  6. #6
    Member
    Join Date
    Nov 2008
    Posts
    52
    Quote Originally Posted by MyFriendIsATaco View Post
    Typically you won't interface with the database directly. It is possible with AS3 now, but I don't know if there is a class written for SQL server. I know there is one for MySQL out there somewhere.

    You should write a server-side script to do the database work, and have it spit back XML for you to digest in Flash. If you're on a Microsoft server, you're probably in a .NET environment. .NET and SQL is not in my expertise at all, so I can't point you in any further direction. I tend to use as many open source technologies as possible.

    Thanks, I'm an expert in .NET and ASP, although I need to focus on Flash ATM, so that's why I'm asking... So you're telling me there is no way for AS3 to interface directly with SQL server? I've been browsing a lot online, but I see nothing, and I really do not want to hard code values into the flash project...

  7. #7
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    For a real crude example since I don't know .NET or ASP, this is about how it would work:

    Flash makes a request out to dosomething.aspx. POSTs variables or whatnot. Then dosomething.aspx will query the database and render the results as XML. Then Flash just handles the result as a normal XML file.

  8. #8
    Member
    Join Date
    Nov 2008
    Posts
    52
    Quote Originally Posted by MyFriendIsATaco View Post
    For a real crude example since I don't know .NET or ASP, this is about how it would work:

    Flash makes a request out to dosomething.aspx. POSTs variables or whatnot. Then dosomething.aspx will query the database and render the results as XML. Then Flash just handles the result as a normal XML file.
    Sounds good. How do I handle XML in Flash? Any tutorials on how to parse XML files in Flash? Thanks a lot!

  9. #9

  10. #10
    Member
    Join Date
    Nov 2008
    Posts
    52
    Well I was making a post but it seems it didn't go through... :\

    I was thinking about a simple question:

    How would you tell flash that the query to the database is complete and that the XML file is ready for use?

    I found a caveman solution to the problem, but it is not as kusher as I would like it to be... Read the file in flash until you read a known variable which marks a successful transaction, such as <success>success</success>. I don't like the idea of possible infinite loops, so I'm wondering if Flash has a function I, The New Guy, don't know about...

    Thanks a lot...

  11. #11
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    That's not even an issue. It's not like the bytes are streaming into Flash one by one, and the characters are being assembled as your code executes. Just listen for the Event.COMPLETE for your URLLoader object, and you're good to go.

Tags for this Thread

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