A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: upload a picture of your face question

  1. #1
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,121

    upload a picture of your face question

    Somebody ask me for a game where you can upload your face in order to play

    I know this kind of thread is been discussed in the past but I cant find any

    How can I do do that?
    How to upload a picture of a player to add to a game?

    Can somebody give me some ideas or help on this


    "I love to make them as I love to play them"

  2. #2
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    using php? - I guess that would answer most questions. There is a way init the OS "dialogue to select a file " from within flash (starting flash player 7+) though I never played with it- variables then from the file location (or something like that) then can be passed to php in order to opload that data

  3. #3
    Senior Member AzraelKans's Avatar
    Join Date
    May 2002
    Location
    Hell... with frequent access to heaven ;)
    Posts
    409
    Hmmm.. Im not sure, but I think you could use AS 3.0 camera and the Bytes object (im not sure of the name) to actually store the picture in a temp file.

    Anyway is not needed, in regular As2.0 create a camera object, copy that surface and then use copypixels (or a draw) to use it as an sprite. I think I have some code here on how to store your camera image (for "motion sensing" purposes)

    edit: OOps! you meant without a camera. Is simple just use a web form to upload a file, there are more complicated methods but you dont need anything else.

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

  5. #5
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    Quote Originally Posted by scheletro
    Somebody ask me for a game where you can upload your face in order to play

    I know this kind of thread is been discussed in the past but I cant find any

    How can I do do that?
    How to upload a picture of a player to add to a game?

    Can somebody give me some ideas or help on this
    www.racemyface.com

    I created that.

  6. #6
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    Quote Originally Posted by Boombanguk
    I created that.
    it still doesn´t help with the initial question

  7. #7
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    Quote Originally Posted by renderhjs
    it still doesn´t help with the initial question
    I wanted to show him that its something I've done, i.e he can ask me what he wants, and I'll try to help him out. Btw..

    Basically you need a php script to take the image from Flash,and upload it to a directory on your server. Once its there you can download it again into flash for display.

    thats all pretty straightforward stuff. The real tricky bit is how you will incorporate your image into whatever it is you want. For Racemyface ppl can actually choose what part of the downloaded image they want to place into the game. It uses dynamic masking, and getting it all lined up was a pain in the butt.

  8. #8
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,182
    Yeah upload a picture using php. Then load the picture in Flash and allow the user to draw an canvas around it, to use as a mask. So you get decent shapes.

  9. #9
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,121
    Thanks for all your comments guys

    There is a few tutorials for it, heres just a couple.
    Thanks hooligan2001 for those, ill check them out

    www.racemyface.com

    I created that.
    I knew about your game Boombanguk, found a couple of threads about a little problem you had in the game, I was about to contact you, but i wanted to see if there where some tutorials

    Ill check the tutorials hooligan2001 put here and if I have any problem ill contact you because you are right, i need a dinamic masking and some more issues


    "I love to make them as I love to play them"

  10. #10
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    Quote Originally Posted by scheletro
    Thanks for all your comments guys
    Thanks hooligan2001 for those, ill check them out
    I knew about your game Boombanguk, found a couple of threads about a little problem you had in the game, I was about to contact you, but i wanted to see if there where some tutorials

    Ill check the tutorials hooligan2001 put here and if I have any problem ill contact you because you are right, i need a dinamic masking and some more issues
    cool, just post your question here, and I'll reply. (thats if I dont get banned from this place first)
    Last edited by Boombanguk; 07-26-2007 at 12:09 PM.
    FlashGameMaker.com - er..where I say stuff.

  11. #11
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,121
    Questions all

    Because I dont have a clue, I saw those tutoriasl and I think my problem is PHP, the dont seem to work for me and I dont know where the problem is

    I can figure out how to make the masking once you have the picture display in your flash, but first i need that first step


    "I love to make them as I love to play them"

  12. #12
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    whats not working? you know you have to have the flash file online for it to work? if you are already doing that, whats not working?
    FlashGameMaker.com - er..where I say stuff.

  13. #13
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,121
    yeap, upload everything, I know PHP doesnt work locally unless I have running a special program

    Maybe I need to change something in the script, I also give all the permises in my server

    Strange

    Ill keep looking


    "I love to make them as I love to play them"

  14. #14
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    The Flash-db is what I based what I did on.

    ok so you upload those files (the .swf, html and the php) to your server and it doesn't work? The important line in the php is this

    move_uploaded_file($_FILES['Filedata']['tmp_name'], "./images/".$_FILES['Filedata']['name']);

    where "images" is a folder I created to keep all my images.

    If it doesnt work on one server, and you have access to another try another server, because sometimes servers don't allow you to use that php function.
    FlashGameMaker.com - er..where I say stuff.

  15. #15
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    Quote Originally Posted by scheletro
    yeap, upload everything, I know PHP doesnt work locally unless I have running a special program
    you might take a look @
    http://portablewebap.com/
    its a downloadable smal folder (zip file) where you only need to run a exe file and a whole php system with mysql databse is ready to go and opens the localhost in your default browser. No need to install,- if you want to exit it just click exit on the system tray icon.

  16. #16
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,121
    Ill do more tests boombanguk, thanks

    Renderhjs, thanks for the efford but im using a MAC so I cant run .exe files


    "I love to make them as I love to play them"

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