Is this possible with flash?

Discussion in 'Programming' started by pher, Feb 4, 2008.

  1. #1
    Need an application that reads a database, displays text based upon the results of the database. The text is clickable, and based upon the user's selection, makes another database call and returns the resultset. Think of Google Adsense, except when the links are clicked, it refreshes the links to show something else.

    I'm sure this is doable with Flash, but I'm just not familiar enough with Flash to know. Also, this application needs to be hosted on many websites, ie myspace, facebook, etc, not just my server.

    Is Flash an application that can do this? What other methodologies would you recommend?
     
    pher, Feb 4, 2008 IP
  2. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    There is no direct method of connecting to a database in Flash, though there are round-about ways of doing it- the LoadVars class might be something to look into:

    http://www.oman3d.com/tutorials/flash/loadvars_bc/

    With the load() function you could specify what function to execute in php using GET variables, something like

    
    load("http://www.mysite.com/db_query.php?function=1&user=34232")
    
    Code (markup):
    You may also be able to rig something up with Flash sockets.
     
    ToddMicheau, Feb 4, 2008 IP
  3. pher

    pher Well-Known Member

    Messages:
    403
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    125
    #3
    Thanks for the response.

    Is this what YouTube is doing? Streaming the video via a UDP socket connection?
     
    pher, Feb 5, 2008 IP
  4. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #4
    I haven't looked into the source for YouTube's .swf, but since the videos that get uploaded are converted into .flv I think they use flash's built in commands to load .flv files (NetStream class and attachVideo()), so not in quite the same way as creating an XML Socket. (I'm not positive but I don't think flash supports UDP either.)

    But then again we were talking about getting your flash application to pull database info, where did videos come from?
     
    ToddMicheau, Feb 5, 2008 IP
  5. wassim

    wassim Well-Known Member

    Messages:
    322
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Hi,

    flash is capable of doing this with the help of a carefully crafted server side php script that serializes the request and return the dataset in a form flash can understand.

    I can build such an application, pm me if you're interested.

    Regards.
     
    wassim, Feb 5, 2008 IP