Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 6 of 6
  1. #1

    Default Upload A Photo Of You Onto An Existing Photo?

    1 There's a Flash Photo (Of anything). Most likely a person doing something crazy or maybe even a bodybuilder.

    2. You can click a button which brings you to an upload button. You find a photo of your head and click upload.

    3. Your head is now on the picture. You can ussually zoom your head in and out to get it to fit right, and play with contrast.

    4. Once your happy with the photo you can "send it to friend via email".

    Does anyone know where I can purchase or find this on the web? I would need to have the ability to add in our movies production stills. Fans could then add their faces into the photos over other actors.

    Thanks for your help. I've been searching for days on the web with no luck.

    Napolion Dynamite does this on their fan site under "PHOTOS BY DEB"
    http://www2.foxsearchlight.com/napol...guest/main.php

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    The current versions of flash cant handle file upload or download. You would need a backend scripting language for that (e.g.PHP). Check PHP.net for a backend upload script. Once you have the files on your server, as long as they are non progressive .jpg files, you can load them dynamically into a flash movie and scale as needed.
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  4. #3

    Default

    Quote Originally Posted by NTD
    Hi,

    The current versions of flash cant handle file upload or download. You would need a backend scripting language for that (e.g.PHP). Check PHP.net for a backend upload script. Once you have the files on your server, as long as they are non progressive .jpg files, you can load them dynamically into a flash movie and scale as needed.
    Yikes. I'm just looking to find a script for sale that does this. I don't have the patience to build one. I will start searching under "php". Thanks for the heads up.

  5. #4
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    I found a script for this, but I have not tested it and I'm not certain how it works. If you would like to give it a try, here is the source. I dont have any instructions on how to employ it, just code......
    Code:
    <title>Maaking.Com File Uploader</title> 
    
    <script language="JavaScript" type="text/javascript"> 
    <!-- ; 
    var newwindow; 
    var wheight = 0, wwidth = 0; 
    function popitup5&#40;url, title, iwidth, iheight, colour&#41; &#123; 
    var pwidth, pheight; 
    
    if &#40; !newwindow || newwindow.closed &#41; &#123; 
    pwidth=iwidth+30; 
    pheight=iheight+30; 
    newwindow=window.open&#40;'','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10'&#41;; 
    wheight=iheight; 
    wwidth=iwidth; 
    &#125; 
    
    if &#40;wheight!=iheight || wwidth!=iwidth &#41; &#123; 
    pwidth=iwidth+30; 
    pheight=iheight+60; 
    newwindow.resizeTo&#40;pwidth, pheight&#41;; 
    wheight=iheight; 
    wwidth=iwidth; 
    &#125; 
    
    newwindow.document.clear&#40;&#41;; 
    newwindow.focus&#40;&#41;; 
    newwindow.document.writeln&#40;'<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>'&#41;; 
    newwindow.document.writeln&#40;'[img] + url + [/img]'&#41;; 
    newwindow.document.writeln&#40;'<\/center> <\/body> <\/html>'&#41;; 
    newwindow.document.close&#40;&#41;; 
    newwindow.focus&#40;&#41;; 
    &#125; 
    
    // Routines to tidy up popup windows when page is left 
    // Call with an onUnload="tidy5&#40;&#41;" in body tag 
    
    function tidy5&#40;&#41; &#123; 
    if &#40;newwindow && !newwindow.closed&#41; &#123; newwindow.close&#40;&#41;; &#125; 
    &#125; 
    
    </script> 
    
    
    
    <?php 
    /* 
    Author&#58;     Mohammed Ahmed&#40;M@@king&#41; 
    Version&#58;    1.0 
    Date&#58;        10.Oct.2004 
    ---------------------------- 
    Last Update&#58;    15.Nov.2004 
    ---------------------------- 
    E-mail&#58;        m@maaking.com 
    MSN   &#58;         m@maaking.com 
    WWW   &#58;     http&#58;//www.maaking.com 
    
    
    ---Description ----------------------------------------------------- 
    The Super Global Variable $_FILES is used in PHP 4.x.x. 
    $_FILES&#91;'upload'&#93;&#91;'size'&#93; ==> Get the Size of the File in Bytes. 
    $_FILES&#91;'upload'&#93;&#91;'tmp_name'&#93; ==> Returns the Temporary Name of the File. 
    $_FILES&#91;'upload'&#93;&#91;'name'&#93; ==> Returns the Actual Name of the File. 
    $_FILES&#91;'upload'&#93;&#91;'type'&#93; ==> Returns the Type of the File. 
    
    So if I uploaded the file 'test.doc', the $_FILES&#91;'upload'&#93;&#91;'name'&#93; 
    would be 'phptut.doc' and $_FILES&#91;'upload'&#93;&#91;'type'&#93; would be 'application/msword'. 
    ---------------------------------------------------------------------*/ 
    
    //**********************************************************************// 
    //  $_FILES&#91;'filetoupload'&#93;  is the value of                            // 
    // file field from the form. <input type="file" name="filetoupload">    // 
    //**********************************************************************// 
    
    // this is the upload dir where files will go. 
    //Don't remove the / 
    //Chmod it &#40;777&#41; 
    $upload_dir = "images/";   //change to whatever you want. 
    
                 //51200 bytes = 50KB 
    $size_bytes = 51200; //File Size in bytes &#40;change this value to fit your need&#41; 
    
    $extlimit = "yes"; //Do you want to limit the extensions of files uploaded &#40;yes/no&#41; 
    $limitedext = array&#40;".gif",".jpg",".png",".jpeg"&#41;; //Extensions you want files uploaded limited to. also you can use&#58;  //array&#40;".gif",".jpg",".jpeg",".png",".txt",".nfo",".doc",".rtf",".htm",".dmg",".zip",".rar",".gz",".exe"&#41;; 
    
              //check if the directory exists or not. 
              if &#40;!is_dir&#40;"$upload_dir"&#41;&#41; &#123; 
             die &#40;"The directory &#40;$upload_dir&#41; doesn't exist"&#41;; 
              &#125; 
              //check if the directory is writable. 
              if &#40;!is_writeable&#40;"$upload_dir"&#41;&#41;&#123; 
                 die &#40;"The directory &#40;$upload_dir&#41; is NOT writable, Please CHMOD &#40;777&#41;"&#41;; 
              &#125; 
               
      if&#40;$uploadform&#41; // if you clicked the &#40;Upload File&#41; button. "If you submitted the form" then upload the file. 
      &#123;//begin of if&#40;$uploadform&#41;. 
    
    
                  //check if no file selected. 
                  if &#40;!is_uploaded_file&#40;$_FILES&#91;'filetoupload'&#93;&#91;'tmp_name'&#93;&#41;&#41; 
                  &#123; 
                         echo "Error&#58; Please select a file to upload!. 
    »<a href=\"$_SERVER&#91;PHP_SELF&#93;\">back</a>"; 
                         exit&#40;&#41;; //exit the script and don't do anything else. 
                  &#125; 
    
                  //Get the Size of the File 
                  $size = $_FILES&#91;'filetoupload'&#93;&#91;'size'&#93;; 
                  //Make sure that file size is correct 
                  if &#40;$size > $size_bytes&#41; 
                  &#123; 
                        $kb = $size_bytes / 1024; 
                        echo "File Too Large. File must be $kb KB. 
    »<a href=\"$_SERVER&#91;PHP_SELF&#93;\">back</a>"; 
                        exit&#40;&#41;; 
                  &#125; 
    
                  //check file extension 
                  $ext = strrchr&#40;$_FILES&#91;'filetoupload'&#93;&#91;name&#93;,'.'&#41;; 
                  if &#40;&#40;$extlimit == "yes"&#41; && &#40;!in_array&#40;$ext,$limitedext&#41;&#41;&#41; &#123; 
                        echo&#40;"Wrong file extension. "&#41;; 
                        exit&#40;&#41;; 
                  &#125; 
    
                  // $filename will hold the value of the file name submetted from the form. 
                  $filename =  $_FILES&#91;'filetoupload'&#93;&#91;'name'&#93;; 
                  // Check if file is Already EXISTS. 
                  if&#40;file_exists&#40;$upload_dir.$filename&#41;&#41;&#123; 
                        echo "Oops! The file named $filename already exists. 
    »<a href=\"$_SERVER&#91;PHP_SELF&#93;\">back</a>"; 
                        exit&#40;&#41;; 
                  &#125; 
    
                  //Move the File to the Directory of your choice 
                  //move_uploaded_file&#40;'filename','destination'&#41; Moves afile to a new location. 
                  if &#40;move_uploaded_file&#40;$_FILES&#91;'filetoupload'&#93;&#91;'tmp_name'&#93;,$upload_dir.$filename&#41;&#41; &#123; 
    
                      //tell the user that the file has been uploaded and make him alink. 
                      echo "File &#40;back"; 
                      exit&#40;&#41;; 
    
                  &#125; 
                      // print error if there was a problem moving file. 
                      else 
                  &#123; 
                      //Print error msg. 
                      echo "There was a problem moving your file. 
    »<a href=\"$_SERVER&#91;PHP_SELF&#93;\">back</a>"; 
                      exit&#40;&#41;; 
                  &#125; 
    
    
    
      &#125;//end of if&#40;$uploadform&#41;. 
    
    #---------------------------------------------------------------------------------# 
    // If the form has not been submitted, display it! 
    else 
      &#123;//begin of else 
       
          ?> 
          
     
          <h3>&#58;&#58;Browse a File to Upload&#58;</h3> 
          - Allowed Extensions&#58; 
    
             
              <? 
            // print the file extensions 
            for&#40;$i=0;$i<count&#40;$limitedext&#41;;$i++&#41; 
        &#123; 
            if &#40;&#40;$i<>count&#40;$limitedext&#41;-1&#41;&#41;$commas=", ";else $commas=""; 
            list&#40;$key,$value&#41;=each&#40;$limitedext&#41;; 
            echo $value.$commas; 
        &#125; 
        ?> 
         
         
          
     
          - Max File Size = <?echo $size_bytes / 1024; ?> KB  
          
     
          <form method="post" enctype="multipart/form-data" action="<?php echo $PHP_SELF ?>"> 
          
     
          <input type="file" name="filetoupload">
     
          <input type="hidden" name="MAX_FILE_SIZE" value="<?echo $size_bytes; ?>"> 
          
     
          <input type="Submit" name="uploadform" value="Upload File"> 
          </form> 
    
          <? 
       
      &#125;//end of else 
    
    /////////////////////////////////////////////////////////// 
    function del&#40;&#41; 
    &#123; 
          global $upload_dir, $file; 
    
    //$value_de = base64_decode&#40;&#91;file&#93;&#41;; 
    @unlink&#40;$upload_dir."/$file"&#41;; 
    echo"<h2><font color=red>The File &#40;$file&#41; was deleted!</font></h2>"; 
    echo "<meta http-equiv=Refresh content=1;url=index.php>"; 
    
    &#125; 
    //////////////////////////////////////////////////////////////// 
              if &#40; $action == del &#41; 
              &#123; 
                      del&#40;&#41;; 
              &#125; 
    
    
    /*______________________________________________________________________________*/ 
    //   Here is the most interesting part. 
    //    it views the directory contents.....i'll disscuss next version. &#40;ver 2.0&#41; 
    echo "
    
    <hr>
    Current Uploaded Files&#58;
    "; 
    ?> 
    
    <table border="1" bordercolor="#C0C0C0" cellspacing="1"> 
        <tr> 
            <td bgcolor="#F4F4F4">File Name</td> 
            <td bgcolor="#F4F4F4">File Size</td> 
        </tr> 
    
    <? 
    
    $rep=opendir&#40;$upload_dir&#41;; 
    while &#40;$file = readdir&#40;$rep&#41;&#41; &#123; 
        if&#40;$file != '..' && $file !='.' && $file !=''&#41;&#123; 
            if &#40;!is_dir&#40;$file&#41;&#41;&#123; 
    
                            $imgsize = getimagesize &#40;$upload_dir."".$file&#41;; 
    
                            // print the file name and then make a link. 
    // javascript&#58;img&#40;'$upload_dir$file','$imgsize&#91;0&#93;','$imgsize&#91;1&#93;'&#41; 
    
    echo "<tr><td> <a href=\"javascript&#58;popitup5&#40;'$upload_dir$file','$file', $imgsize&#91;0&#93;, $imgsize&#91;1&#93;,'white'&#41;\"> 
                            <img src=$upload_dir$file border=0 width=100> 
                            </a> 
                            </td>"; 
                             
                            #------------begin of file size. 
                            //print the file size. 
                            $file_size = filesize&#40;$upload_dir."".$file&#41;; 
    
                    if &#40;$file_size >= 1048576&#41; 
                    &#123; 
                $show_filesize = number_format&#40;&#40;$file_size / 1048576&#41;,2&#41; . " MB"; 
                    &#125; 
                    elseif &#40;$file_size >= 1024&#41; 
                    &#123; 
                $show_filesize = number_format&#40;&#40;$file_size / 1024&#41;,2&#41; . " KB"; 
                    &#125; 
                    elseif &#40;$file_size >= 0&#41; 
                    &#123; 
                $show_filesize = $file_size . " bytes"; 
                    &#125; 
                    else 
                    &#123; 
                $show_filesize = "0 bytes"; 
                    &#125; 
    
                    echo "<td> $show_filesize"; 
                    echo "
    
    <p align=center>"; 
                            echo"&#91;<a title=\"Delete File\" href=\"javascript&#58;;\" onClick=\"cf=confirm&#40;'Are you sure you want to delete?'&#41;;if &#40;cf&#41;window.location='index.php?action=del&file=$file'; return false;\">Del</a>&#93;"; 
                            echo "</p></td></tr>"; 
                            #------------end of file size. 
    
                    &#125; 
        &#125; 
    &#125; 
    closedir&#40;$rep&#41;; 
    clearstatcache&#40;&#41;; 
    
    ?> 
    </table> 
    <p align=right> 
    
    Script by&#58; <a href=http&#58;//www.maaking.com>maaking.com</a> 
    </p>

    Let me know how it goes
    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  6. #5

    Default

    Thank you. I'm sure someone will find that useful. I am not looking for a file uploader. I'm looking for one of those cool flash ecards where you can upload a picture of yourself to it and replace your face over someone elses. You know what I mean? Like when you stick your face over a bodybuilders face so it looks like you? I see these type of ecards all the time but I don't know where to buy one that I can customize.

  7. #6

    Default

    I figured out the problem. I was looking for this script in "flash" bit it's actually a Shockwave program. Here's what I meant.

    http://www.shockwave.com/bin/greetin...p?id=cns_hunk1

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Help With Photo Transitions
    By earle_area309 in forum Design and Animation
    Replies: 0
    Last Post: 12-12-2006, 05:24 PM
  2. Photo Web Site
    By brianmaysguitar in forum Newbies
    Replies: 1
    Last Post: 12-11-2006, 09:20 PM
  3. Photo explorer
    By Superlysi in forum Advanced Flash
    Replies: 1
    Last Post: 05-01-2006, 11:07 PM
  4. Flash Photo Album
    By mrtrojanap7 in forum Newbies
    Replies: 1
    Last Post: 08-21-2004, 06:29 AM
  5. Photo Fit Game
    By Jack in forum Advanced Flash
    Replies: 0
    Last Post: 04-16-2004, 10:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial