A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: upload image by user and use it in swf file

  1. #1
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713

    upload image by user and use it in swf file

    Hello,
    I have been trying to get an image that could be uploaded by a user and then loaded into a swf file on a web site. I can use PHP. It would be like a users pic be incorporated into a swf file. Pehaps inserted into a movieClip onto the swf.
    Any programming language is at its best before it is implemented and used.

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    use the FileReference class for uploading images to the server. have a look at http://www.tink.ws/blog/filereference-example/ for an example.

    Once the image is on the server you can download it using the MovieClipLoader class and show it to the user
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Hello,
    Thank you. I will try this and let you know.
    Any programming language is at its best before it is implemented and used.

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    your welcome
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  5. #5
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    I have not started this yet but I was thinking of another problem, If I get the pic onto the server and it appears in the swift with maybey movieLoader, I need to erase it so oher users cannot use it. What I am doing is something like at Bennigans restuarant. But simpler.

    http://www.innerleprechaun.com/lepregrams.html

    There is no registration here so I cannot imagine how 12 people could use this site at a time.
    Any programming language is at its best before it is implemented and used.

  6. #6
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    sorry i dont really understand the question - what do you mean erase it so others cant use it and 12 people cant use it at the same time?
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  7. #7
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Quote Originally Posted by silentweed
    sorry i dont really understand the question - what do you mean erase it so others cant use it and 12 people cant use it at the same time?
    If a user uploads a picture and uses it in a picture and then leaves the site, what keeps the next user from loading the first users pic?

    If you look at the Benniganns program were a user uploaded his picture and uses it while another user does the same thing, what makes the swf file keep from mixing up the pictures with each user?
    Any programming language is at its best before it is implemented and used.

  8. #8
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    if two different people are on two different computers, if an image has been downloaded and viewable in one swf it doesnt mean the other person will see the that image.

    The only way one person can download another persons image is if he directly browses to their image name on the server e.g www.abc.com/someimage.jpg

    When you upload a picture to the server, make sure you give it a unique name so it doesnt overwrite any existing images of other users on the server..

    You can more or less guarantee a unique name by giving each image that is being uploaded the name new Date().getTime()

    (the name will end up being a timestamp in milliseconds - number of milliseconds since midnight January 1, 1970)
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  9. #9
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713

    Talking

    Thank you again. It begins to make sense to me.

    http://www.frameafriend.co.uk/
    is perfect.
    Last edited by tmoore935; 01-20-2008 at 07:54 PM.
    Any programming language is at its best before it is implemented and used.

  10. #10
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Hello,
    This is how far I have gotten.
    I can get a picture up to my server/URL from a users pc. I can see it in a folder that I made when I FTP to the site. Ok, easy enough. Even though its online now, I cannot see how to get the swf file to call it and use it since each picture has a different name.

    Hope this makes sense.
    Any programming language is at its best before it is implemented and used.

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