;

PDA

Click to See Complete Forum and Search --> : dynamic pictures/e-mail out of flash


neederofhelp
10-24-2003, 08:44 PM
Hey, I know this sounds like internetvirus's question but no. I'm not him. If you remember, I'm working on my youth groups website and I'm almost done! Two more quesions:

1) We take pictures of our meetings every week and we like to put them up on the internet. When I was exploring with dynamic pictures, I found that you can export imported pictures as outside files and when you change them, they change the pic in the flash file.
PROBLEM: What ever size of picture I put in the folder, that's the size that appears on the flash movie? Do you know what I mean? I Don't! LOL Uh, i mean if i put in a large picture in place of the picture that i exported from the file, it takes up the rest of the screen. Anywho, my question is HOW DO I KEEP THE SIZE OF THE PICTURE CONSTANT? Like in html, you'd say img src="me.gif" width =70 height-70
can you do something like that in 3DFA?

2) I want a pull-down menu to select a staff's e-mail address. Then I want them to be able to type a message in right there and not have to go through Outlook or AOL or something like that. Could you guys help me with that? Thanks!

BTW, I want to thank Bret again for all his help with transfering variables to a .txt file. I'll be sure to show you guys my final results when I'm done with the site!

The Cheat
10-24-2003, 10:12 PM
HOW DO I KEEP THE SIZE OF THE PICTURE CONSTANT
Use some sort of image editor, and resize the images to the same size. Remember to keep the scale the same or your pictures will probably look funky. You could also try using the tools on the left in 3DFA...

And for #2, you will need to use some sort of server side language like php, asp, cgi, etc... You can use a form in 3dFA, but you will need a server side file to handle the form.

:)

neederofhelp
10-24-2003, 11:02 PM
Ok The Cheat (Is that from homestarrunner.com?),

I gotcha on number 1. I got the picture thing all great like. I don't get #2 though. I figured I'd probably have to use PHP or something but how? I have a pull-down menu that sets the e-mail who you are sending the e-mail to, then you type in the subject then your message. When you click send though, it opens up your default mail client!!! So, how exactly would i perform such a task as to send it through the internet using PHP?

blanius
10-25-2003, 12:22 AM
the simplesest email from PHP is this

<?php
$to=$_POST['to'];
$subject=$_POST['subject'];
$message=$_POST['message'];
$headers="ReplyTo:".$_POST['from']."\n\r";
$headers.="From:".$_POST['from']."\n\r";
$success=mail($to,$subject,$message,$headers);
?>

call this from 3dfa after setting the variables
to
from
subject
message

Then in 3dfa Call Loadvariables ('thisphpfile.php','POST');

The only tricky part is the $headers
you have to end each one with Line feed and Carriage return which is the \n\r part
After you call this PHP 3dfa will have had the varibale success set to true or false if successful.

blanius
10-25-2003, 12:22 AM
Oh and by the way you can dynamically resize an image using PHP as well. But I not going there today....

The Cheat
10-25-2003, 10:55 PM
(Is that from homestarrunner.com?)
YA :D

neederofhelp
10-28-2003, 09:00 PM
Originally posted by blanius
the simplesest email from PHP is this

<?php
$to=$_POST['to'];
$subject=$_POST['subject'];
$message=$_POST['message'];
$headers="ReplyTo:".$_POST['from']."\n\r";
$headers.="From:".$_POST['from']."\n\r";
$success=mail($to,$subject,$message,$headers);
?>

call this from 3dfa after setting the variables
to
from
subject
message

Then in 3dfa Call Loadvariables ('thisphpfile.php','POST');


Ok, just double checking here, that PHP will send the e-mail out through the internet? It won't open up their default mail client right? And I just make the text boxes in 3dfa with those variables?

BTW, I scraped the dynamic picture thing, figure it's just easier to do it in HTML and pop-up the page through flash. (I love your pop-up coder bret!!!)

blanius
10-28-2003, 09:16 PM
Originally posted by neederofhelp
Ok, just double checking here, that PHP will send the e-mail out through the internet? It won't open up their default mail client right? And I just make the text boxes in 3dfa with those variables?

BTW, I scraped the dynamic picture thing, figure it's just easier to do it in HTML and pop-up the page through flash. (I love your pop-up coder bret!!!)

Yeah that's what it does. It uses the domains SMPT server directly.

neederofhelp
11-17-2003, 07:06 PM
Okay, I tried that and it doesn't seem to be working.

My server does support this!

blanius
11-17-2003, 07:12 PM
Originally posted by neederofhelp
Okay, I tried that and it doesn't seem to be working.

My server does support this!

Tried what the email? What error are you getting?


BTW heres a bit of code to resize an image


In place of your image name you use the name of this script and pass the the name of the source image and the width and height you want
i.e. <i m g src=myresize.php?myimage.jpg,200,300> ignore the spaces needed for posting to forum

<?php
function setSize($old,$ow,$oh){
$src=ImageCreateFromJPEG($old);
$width=ImageSx($src);
$height=ImageSy($src);
$x=$ow;
$y=$oh;
$dst=ImageCopyResampled($dst,$src,0,0,0,0,$x,$y,$w idth,$height);
ImageJPEG($dst,$old);
ImageDestroy($dst)
ImageDestroy($src)
}
?>

ForumNewbie
11-24-2003, 01:28 PM
Hi Folks,

I don't know if this helps, but I couldn't get the mail part to work at first either.

I hope my terminology is right, but it would only allow me to send e-mail to and from addresses on the domain of the PHP server. ie. bob.smith@thisserver.com could only send to other people at x.y@thisserver.com, but not to x.y@anotherserver.com.

Apparently, there are some SMTP server parameters needed, in order to be able to send e-mail externally.

Maybe this is the problem reported 2 messages up in the thread.

Hope this is useful input.

ForumNewbie

blanius
11-24-2003, 02:49 PM
I would assume that if that is the case it is a setting in the server's SMPT , as this is NOT a native limitation in PHP. We use basically (actual code we use is a bit more advanced)the above code on many sites without a problem.

neederofhelp
11-25-2003, 09:42 AM
I got it, I mispelled my variable, that's all. Silly me. Ok, thanks for your help guys, the site works now! Woohoo!!!!

:) ::D ;) :p :cool: :cow: :doughnut:

mmm. doughnut

ForumNewbie
12-06-2003, 04:13 PM
After you call this PHP 3dfa will have had the varibale success set to true or false if successful.


I really need your help folks !!

Whenever I try to use PHP scripts like this, (to get a variable from PHP back into the flash file), I can never manage to find the variable back within my movie.
ie. If I use exactly this example above, I can send the mail using 'loadVariables'. Back in 3dfa, if I make an editbox to show the variable 'success' after completion, the variable success is just blank.

The same is true if my PHP script just says:

<?
$success="Please let this appear in my flash movie";
?>

Hence I can only conclude something is stopping my PHP talking to my swf file. I'm sure this is something ridiculously simple, so please put me out of my misery !

What is the trick to getting my PHP variable accessible in my flash file?

Thanks,

Morgan.

blanius
12-07-2003, 09:31 AM
you have to actually have the PHP send the variable with an echo command like

echo "&success=".$success;

ForumNewbie
12-07-2003, 11:29 AM
Excellent Brett,

Thanks :D

Only wish I'd asked 6 months ago, when I first wondered how to do it!

My end goal is to turn my infamous dart movie into a multiplayer game. Not far to go now. :D

Thanks again,

Morgan.