-
Ride 'em FISHY!
dynamic pictures/e-mail out of flash
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!
Dan
Oops. I broke it.... again.
-
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.
-
Ride 'em FISHY!
gotcha=1...not 2
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?
Dan
Oops. I broke it.... again.
-
KoolMoves Moderator
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.
-
KoolMoves Moderator
Oh and by the way you can dynamically resize an image using PHP as well. But I not going there today....
-
(Is that from homestarrunner.com?)
YA
-
Ride 'em FISHY!
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!!!)
Dan
Oops. I broke it.... again.
-
KoolMoves Moderator
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.
-
Ride 'em FISHY!
bret, i tried that
Okay, I tried that and it doesn't seem to be working.
My server does support this!
Dan
Oops. I broke it.... again.
-
KoolMoves Moderator
Re: bret, i tried that
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 Code:
<?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,$width,$height);
ImageJPEG($dst,$old);
ImageDestroy($dst)
ImageDestroy($src)
}
?>
Last edited by blanius; 11-17-2003 at 08:31 PM.
-
A Senior Newbie - How Odd
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
-
KoolMoves Moderator
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.
-
Ride 'em FISHY!
-
A Senior Newbie - How Odd
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.
-
KoolMoves Moderator
you have to actually have the PHP send the variable with an echo command like
echo "&success=".$success;
-
A Senior Newbie - How Odd
Easy When You Know How
Excellent Brett,
Thanks
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.
Thanks again,
Morgan.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|