Link to home
Start Free TrialLog in
Avatar of Kevin
KevinFlag for United States of America

asked on

FLASH variables in a Movie sent to php

OK I am making baby steps thanks to your help.  Trying to learn more about how to properly handle variables.  I have a file

http://www.fiberfilmfestival.com/testmail.fla

(You can look at it and run the compiled version

http://www.fiberfilmfestival.com/testmail.html  )

that I want to use to send me an email.  As you can see there is a movie clip that I named contest.  I have some borrowed script that I tried to adapt to check the fields, and if OK send to the sendemail.php file (also in the same server directory).  But it isn't working right.  If I watch it debug for example with the top input box empty (where the name should go) it should prompt me to add the name, but it doesn't.  B/c I don't have the variables right yet.

NOTE THAT EVENTUALLY THIS SWF WILL BE PLAYED _INSIDE_ OF ANOTHER SWF FILE, if that makes a difference for later.

Again thanks for your help (you know who I am talking about...)
Avatar of Billystyx
Billystyx

can you post the php too?
Avatar of Kevin

ASKER

should already be at

http://www.fiberfilmfestival.com/sendemail.php

(thanks for the continued help, BTW)
no, the actual file, php doesn't diplay anything but output in html - because it has processed already by the time you see it.
I need the bit that starts
<?php
and finishes
?>

billystyx
Avatar of Kevin

ASKER

Duh - I see what you mean.  Here it is...

<?
      $subject = $_POST['subject'];
      $message = $_POST['comments'];
      $from = "From: ".$_POST['realname']." <".$_POST['emailadd'].">";
      $to = "entries@fiberfilmfestival.com";
      /* if (isset($_POST['reply']) && $_POST['reply']=="1") $message .= "\n\nReply Requested"; */

      /* and now mail it */
      $mail_success = mail($to, $subject, $message, $from);
      if ($mail_success == true) {
            echo '&faultCode=0&';
      } else {
            echo '&faultCode=1&';
      }
?>
Avatar of Kevin

ASKER

Maybe you just tried it (14:51 Central time)  I just got two emails in.  But there is no information in them...
you have the check line commented out there
if(isset...
not that that is incredibly important, but so you know, remove the /* and
*/ from either end of that line.
<?
     $subject = $_POST['subject'];
     $message = $_POST['comments'];
     $from = "From: ".$_POST['realname']." <".$_POST['emailadd'].">";
     $to = "entries@fiberfilmfestival.com";
     /* if (isset($_POST['reply']) && $_POST['reply']=="1") $message .= "\n\nReply Requested"; */

     /* and now mail it */
    mail($to, $subject, $message, $from);
     $myVar="&faultCode=1&";
print($myVar);
?>

I would do the php file like that...
(and I am just checking the fla now)
billystyx
Sorry I hope you haven't been polluted with emails since I started to test this:)

Have you got any - I thinkyou will have at least one.
Let me know, and if so I will upload your file.

Billystyx
Avatar of Kevin

ASKER

I have received about 7 between 3:02 and 3:55 p.m.Central time.  Unfortunately they do not have anything in the From field or the subject field or a message :(
SOLUTION
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Haha...  I've got an automated reply from you...

---
We are glad to have you as a part of our Contest. All official paperwork required to enter the Contest is available here
---

Let me know if you were not able to get that attachment...

CyanBlue
Avatar of Kevin

ASKER

Yes it seems to work.  Now I need the swf file to appear within another swf file.  

Q1. Everything should still work the same?

Q2. Also, to make sure that I understand this stuff - remember I am new at this - is that in Frame 1 the movie clip didn't have an instance assigned, and _all_ you had to do was name it in the frame ?

Q3.  The php file didn't need to be changed ?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kevin

ASKER

Billy,

so on q2., if I have my incidence in this file (which is actually named "page5.swf") named _contest, that will be OK when called from the MAIN file ?  The button in the MAIN file that will launch _this_ file says:

on (rollOver) {
      gotoAndPlay(2);
}
on (releaseOutside, rollOut) {
      gotoAndPlay(20-_currentframe);
}
on (release) {
      _root.camera.gotoAndPlay(88);
      if (_root.pressed_link<>5) {
            _level2.gotoAndPlay("dissappear");  //I think that this fades the existing stuff in the contact area...
            _root.pressed_link = 5;
      }
}

The name of the MAIN file that I will use for the contact information (that came with this template) is page5.swf, so I guess that somewhere "_root.pressed_link = 5" translates into "page5" to know which file to launch...
Avatar of Kevin

ASKER

Billy, I would gladly like to see your version to, too help me to learn this stuff...
If you are still having problem, can you post the main.fla file, testmail.fla file and the sendmail.php file???

As for Q2, what Billystyx is correct, but somehow Flash was not able to access the variables when the instance name was not given in frame 1...  Not sure why though...
I can post it in a few hours - in the meantime, where is your loadMovie, loadMovieNum to load the second swf?

Also, it is a good idea to name your loadVars name without the '_' - (I don't think its necessary but it throws me on popular variable naming convention)
and if you are using loadMovieNum to load the movie, then the path to the variables there will be
_level1.contest (if level1 is where it is loading to)

Your last comment I am not sure about (don't know what you mean - but I will take another look at the file).
If there is a switch statement at the end of dissappear that loads the movie depending on the value of pressed_link then I guess this might be correct - but I can't remember and don't have access to flash right now to check.

I will do so soonish

Billystyx

Avatar of Kevin

ASKER

the last frame of "disappear" has this...

load_link = "page"+_level0.pressed_link+".swf";
loadMovieNum(load_link, 2);
stop();
Avatar of Kevin

ASKER

Taking it one step further, opened a new question to be able to give more points...

https://www.experts-exchange.com/questions/21419079/Part-II-FLASH-variables-in-a-Movie-sent-to-php.html

Thanks everyone!
Thanks:) Good luck - I will check out later if noone else has answered your q

billystyx