Welcome, Guest. Please login or register.
Did you miss your activation email?
02/07/12, 07:40
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Recent Tutorial Support
| |-+  Flash Ecards (Moderators: Flash-db, vesa kortelainen, Ronald Wernecke, Mohsin Sumar, Jorge Solis)
| | |-+  Is it possible to modify for just one Ecard?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Print
Author Topic: Is it possible to modify for just one Ecard?  (Read 6449 times)
Scribbles
Server what's that
*
Posts: 12


View Profile Email
« on: 12/30/08, 13:14 »

Hey guys,

I know this is an old tutorial but it has really helped me start putting together an email Ecard for a company i work for. I am fairly new to the whole programming thing but have managed to do this so far.

I created the Ecard in Flash (cs3), added text fields, created the SendEcard.PHP file and it correctly sends emails to whomever i send it to (with the Reply button replying to whatever email address they put in as their own), the PHP file also creates the txt file and saves it in the right spot on the server, with all of the information that is put in the flash file.

The problem I am having is that when I click the link that comes in the email, it goes to

.../ECards/Selectcard.php?EcardText=1230659567&ENum=

the page is blank.

I have a feeling that the problem is in my lack of knowledge as to how to turn the Selectcard.php file into just opening up the 1 flash file everytime with the information saved in the EcardText file.

I am on a deadline and would appreciate ANY help with this even if it is not the whole solution, but merely an idea or part.

Thanks
Logged
Scribbles
Server what's that
*
Posts: 12


View Profile Email
« Reply #1 on: 12/30/08, 17:57 »

OOoook, I have an update.

After hours of playing around with it I have gotten to the point where now the flash card comes up when the link in the email is clicked, but the text    "_level0.FromName"     is in the text box (FromName is one of the Instance and Variable names in Flash). The file is still being created to my dBText folder with all of my information so the problem seems to be that the flash file is just not getting my information from the file that is created when the send button is pressed.

If it was just one file i could easily have the variables load into their respective spots but, i have no idea how to make it so that it reads the file name that is randomly created.

Again, any help would be greatly appreciated.

Thanks
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #2 on: 12/31/08, 03:26 »

Hi,
it is important for you, and your future projects, to understand the loading and saving tutorials.

After you understand this, you can update the eCard application.

Thing have changed since Flash4/5, and especialy the communication is one area, which became much much better.

Important to know is, how does Flash communicate with scripts?

To your case: if you are stuck, it is helpful for us, to have a life link, where you have the files online, and php error reporting at this server is switched to on.

Dont use levels anymore and give instance names to your components.

Further it could help you debuging, when you use Charles (more details in the loading and saving tutorials).
« Last Edit: 12/31/08, 03:29 by Ronald Wernecke » Logged

happy flashing
Cool
Ronald
Scribbles
Server what's that
*
Posts: 12


View Profile Email
« Reply #3 on: 12/31/08, 09:38 »

Thank you very much for the response. I really appreciate the help. A link to the live file is:

http://www.scribbles.comze.com/ECards/E_Card.swf


All of my files are hosted here:


http://www.scribbles.comze.com/ECards/Zip_File.rar


Again, when you run the Ecard all of the information is submitted and created in a document with the correct name and everything, I just  cant get that information to load back into the ECard.

Thanks!
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #4 on: 12/31/08, 11:10 »

Your path inside of your php file is set wrong.
Your DBText-files are looked in a subfolder of standard, but it is a subfolder of ECards.

Make sure all paths and returnvalues match your situation.
Logged

happy flashing
Cool
Ronald
Scribbles
Server what's that
*
Posts: 12


View Profile Email
« Reply #5 on: 12/31/08, 11:24 »

So when you say that do you mean that my SelectCard.php file is trying to get the EcardText file in the wrong spot? I would imagine so just becuase my sendecard.php file seems to be working correctly.

Would that mean that I would have to change this part of the file:

<?
$EcardText = $_GET["EcardText"];

$goto = "SingleCard.swf?EcardText=".$EcardText;
$gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=1";
$Dimensions = "WIDTH=480 HEIGHT=330";
$DimensionsFooter = "WIDTH=480 HEIGHT=330";

?>

to make it so it went into the right folder? I am not sure where to add that in. I have looked through the tutorials you suggested and found some great information and can make it so my swf file loads the information from a text file but, my problem is i don't know how to make it go into my dBText older and select the correct file that was just created.

If you wouldn't mind, could you possibly tell me where to put the information so that it finds the dbtext folder instead of just the subfolder of standard?

Thanks
Logged
Scribbles
Server what's that
*
Posts: 12


View Profile Email
« Reply #6 on: 12/31/08, 16:50 »

Ok well I added a new CREATE .TXT FILE command section into my SelectCard.php file to make sure that it was collecting the EcardText File number and it worked, i got another text file created in a different directory with the correct number. (for example: 1230753066.txt). I see now that the problem is that it is not loading the variables in that file into the flash file.

Here is my SelectCard.php file now:



<HTML>
<HEAD>

<TITLE>Here's your Flash Ecard From Me</TITLE>

<?
$EcardText = $_GET["EcardText"];
$filename = $EcardText.".txt";

$info = "FromName=$FromName&FromNumber=$FromNumber";
//this is pretty pointless seeing as it can't find the $FromName or $FromNumber variable.
//the text file it creates just says FromName=&FromNumber=.

$fp = fopen( "./Test/$filename","w");
fwrite($fp, $info, 1000);
fclose( $fp );

?>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
<p align="center"><font face="Arial" size="11" color="#666666" letterSpacing="0.000000" kerning="1"><b>(Your Name)</b></font></p>
-->
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
   if (AC_FL_RunContent == 0) {
      alert("This page requires AC_RunActiveContent.js.");
   } else {
      AC_FL_RunContent(
         'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
         'width', '480',
         'height', '330',
         'src', 'SingleCard',
         'quality', 'high',
         'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
         'align', 'middle',
         'play', 'true',
         'loop', 'true',
         'scale', 'showall',
         'wmode', 'window',
         'devicefont', 'false',
         'id', 'SingleCard',
         'bgcolor', '#ffffff',
         'name', 'SingleCard',
         'menu', 'true',
         'allowFullScreen', 'false',
         'allowScriptAccess','sameDomain',
         'movie', 'SingleCard',
         'salign', ''
         ); //end AC code
   }
</script>
<noscript>
   <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="480" height="330" id="SingleCard" align="middle">
   <param name="allowScriptAccess" value="sameDomain" />
    <param name="FlashVars" value="FromName=$FromName" />
   <param name="allowFullScreen" value="false" />
      <param name="movie" value="<? "SingleCard.swf?EcardText=".$EcardText; ?>" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />   <embed src="<? "SingleCard.swf?EcardText=".$EcardText; ?>" FlashVars="FromName=$FromName" quality="high" bgcolor="#ffffff" width="480" height="330" name="SingleCard" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
   </object>
</noscript>
</body>
</html>


and the only script i have in my flash file is this, and it is in the first frame's actions panel:



myData = new LoadVars();
myData.load("http://www.scribbles.comze.com/E-Cards/dBText/"+EcardText+".txt",0);
myData.onLoad = function(success) {
   if (success) {
       FromName.text = this.FromName;
       FromNumber.text = this.FromNumber;
           
   } else { trace("Error loading data");
   }
}




Thank you!
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #7 on: 01/01/09, 08:47 »

you write into ./test/filename, but read from DBText/filename
Logged

happy flashing
Cool
Ronald
Scribbles
Server what's that
*
Posts: 12


View Profile Email
« Reply #8 on: 01/01/09, 19:22 »

you write into ./test/filename, but read from DBText/filename

Well, the file that im asking it to save into the ./test directory is just a test file to see if it is collecting the "ecardtext" file. My actual SendEcard.php file is:

<?

$CreateEcard = date(U);

$filename = $CreateEcard.".txt";

$ToName = $_POST["ToName"];
$FromName = $_POST["FromName"];
$Greeting = $_POST["Greeting"];
$FromEmail = $_POST["FromEmail"];
$ToEmail = $_POST["ToEmail"];
$FromNumber = $_POST["FromNumber"];
$Today = (date ("l dS of F Y ( h:i:s A )",time()));

$Created="Ecard Created on $Today";

$EcardNum = $_POST["EcardSelect"];

$EcardText ="ToName=$ToName&ToEmail=$ToEmail&FromName=$FromName&FromNumber=$FromNumber&FromEmail=$FromEmail&Greeting=$Greeting&FromNumber=$FromNumber&Created=$Created";


$fp = fopen( "./dBText/$filename","w");
fwrite($fp, $EcardText, 10000);
fclose( $fp );

######Email Card########
## You can change the subject and the message part around.
## Make sure to change the Link as stated in the Tutorial.
## (Change from 'someSite' to your actual site - leave the rest the same


$sendTo = $_POST["ToEmail"];
$subject = "Hey! " . $_POST["FromName"] ." ". "wants to help you save money!";
$headers .= "Reply-To: " . $_POST["FromEmail"] . "\r\n";

$headers .= "Return-path: " . $_POST["FromEmail"];


$message = "$ToName,\nYou have recieved a Flash card from $FromName. \nClick the following link to view your card:\n\n http://www.scribbles.comze.com/ECards/SelectCard.php?EcardText=$CreateEcard&ENum=$EcardNum\n\n-----------------------------------\nHere is the message that was sent:

\n$ToName,

\n$Greeting\n$IntroMessage\n\n-$FromName\n\n\n-----------------------------------\nThis card was sent from www.me.com/\n\nThe ME Team.";


mail($sendTo, $subject, $message, $headers);

## This next line returns a success message to the movie.

#### End #########
## By: Jeffrey F. Hill
## www.flash-db.com

?>


This works pefectly and even saves the data into the correct spot on my drive
 (./dBText/filename.txt). The problem comes where for some reason it isn't getting the variables from that file and putting it into the flash file. I set the flash file up to read from the ./dBText folder (where the text file is being saved from the SendEcard.php).

That really makes me think that the problem is in my SelectCard.php file or my flash file.


Do you see a problem in my code for my SelectCard.php  OR my flash file file that could cause it to not get the variables from the EcardText even though it see's the file(thats what saving the test file shows me)?

Thanks again for the help, i really really appreciate it.
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #9 on: 01/02/09, 03:30 »

as far as I can see from here, you have mismatching path entries.

If you try to open a file, you can see, that you are trying from Test.

Did you install Charles?
Logged

happy flashing
Cool
Ronald
Scribbles
Server what's that
*
Posts: 12


View Profile Email
« Reply #10 on: 01/02/09, 10:01 »

Yes I have installed and ran it. I am confused exactly as to how to read what it is telling me but, from what I can see it looks as though the SendECard.php file is working great and sending my request through great. The problem is when I click on the link in my email it does this (or this is what it says in Charles):

-> www.scribbles.comze.com
---> ECards/
------>http://www.scribbles.comze.com/ECards/SelectCard.php?EcardText=1230906334&ENum=

and:

-> www.scribbles.comze.com
---> E-Cards/
------> dBText/
--------->undefined.txt

I saw that my flash file had said E-Cards as the directory to search in so i went in and changed that to ECards . It continues to try to search for an E-Cards folder that doesn't exist. don't know why that is E-Cards I have checked through all of my files and can't find anywhere else where it says E-Cards at all...Is there any way to see where it is?

Thanks
« Last Edit: 01/02/09, 10:04 by Scribbles » Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #11 on: 01/02/09, 10:58 »

The ecard number is not set right.
the filename is undefined.
Check to use the right instance names.
Logged

happy flashing
Cool
Ronald
Scribbles
Server what's that
*
Posts: 12


View Profile Email
« Reply #12 on: 01/02/09, 15:44 »

Yeah, everything seems to be working right up until it searches for the text file to get the variables from. I have it set up as

myData = new LoadVars();
myData.load("./dBText/"+EcardText+".txt");
myData.onLoad = function(success) {
if (success) {
    FromName.text = this.FromName;
    FromNumber.text = this.FromNumber;
           
} else { trace("Error loading data");
}
};

It searches in the correct folder on my server but for some reason doesn't collect the EcardText variable to put into the second line ^above. I checked to make sure all my variables are correct and the one in my SendEcard and SelectCard PHP files is the same (EcardText). Is there something else I have to put into the flash file to make it collect that number?
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #13 on: 01/04/09, 13:17 »

It looks like it is the fault of your hoster.

You receive free hosting, but they send advertising text with your file - this cannot be interpreted by flash.

There is only one solution - change the hosting company!
Logged

happy flashing
Cool
Ronald
Scribbles
Server what's that
*
Posts: 12


View Profile Email
« Reply #14 on: 01/04/09, 13:54 »

ahhhh this is really frustrating. I changed hosting providers and still am having the same problem. it is running everything flawlessly but then the flash file tries to search for a file that it can't find (because it is just Undefined.txt). Do you see any problems in my actionscript in flash?

Also, how can the variable "EcardText" be put into flash file if it can't find the file to get it from? It need's that variable to put into the link to find the file...

Thanks so much for all of your help. I really appreciate it and sorry for bombarding you with questions but I just don't understand why this isn't working, everything looks right (haha clearly its not but...).
Logged
Pages: [1] 2 Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!