Flash & PHP Project help

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

  1. #1
    Hello, I hired a graphic designer do an interactive flash
    project for me, where the user can go to the site and
    upload his/her favorite pic and the end result is that the pic
    is now part of the flash. and so that users flash can now
    be seen at http://mysite.com/?code=12323433 OK, what
    i need to do is, give the user an html code he/she can copy
    and put up on their myspace/facebook or whatever. any info
    would be appreciated.
     
    movidalatina, Feb 4, 2008 IP
  2. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #2
    Just use a swf embed with flashvars generated by php.
     
    Kaizoku, Feb 4, 2008 IP
  3. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Elaborating on Kaizoku's response, when the user uploads the image store the path to the image as well as their userid inside of an sql table. Then create a php script that retrieves the user id through GET variables, it then query's the sql table and retrieves the image path. Once you have the image path php will echo something like:

    imagePath=http://yoursite.com/uploads/432342.jpg

    Then using flash's loadVars() function query your php script like:

    object.load("http://yoursite.com/getImage.php?userid=3323");

    Now you have the path to the image you can load it inside of flash with the Loader Component. Here are some tutorials I've found on the subject:

    http://www.oman3d.com/tutorials/flash/loadvars_bc/ - loadVars() Tutorial
    http://www.lukamaras.com/tutorials/actionscript/load-jpg/loading-external-jpg-image.html - Using the Loader Component
    http://www.oman3d.com/tutorials/flash/load_images_bc/ - Using the Loader Component
     
    ToddMicheau, Feb 5, 2008 IP
  4. movidalatina

    movidalatina Well-Known Member

    Messages:
    1,268
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    105
    #4
    Thank you both, for your input..
    that's why i love DP, such fine people.
     
    movidalatina, Feb 5, 2008 IP