Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE FLASH: Adobe Flash ForumAdobe Flash TutorialsAdobe Flash Video TutorialsWeb Streaming ForumAdobe Flash

help with variables

Cow Forums : Adobe Flash
help with variables
by rlonac on Sep 8, 2007 at 1:58:11 am

Hey Everyone,

I have a flash movie (ecard) that has a series of input text fields for the user to fill. I wrote a php script to recieve the posted variables and render the preview version with the variables. The server was running the php, but not showing the dynamic html.
I had forgotten that flash had called the php and so the php was talking to it without a place to display the new html.

So then I thought I would just bypass the php, create an empty movie clip and load the external swf with the varibles.

I am having trouble doing that, though. Here is the actionscript from my preview button:

_root.createEmptyMovieClip("swfHolder", _root.getNextHighestDepth());
swfHolder.loadMovie (previewCard);

it shows the preview card, but the text for the card is not loading.

May I have some help loading the variables from the root timeline to the new movie clip?

Or, is it possible to take variables from flash -> post to php -> render preview card in specific div or in new page and view it?

the send function works in a similar way, but returns a successful sent notice to the choose ecard movie where the user fills out and sends it from.

thanks so much,

Ryan

Respond to this post   •   Return to posts index

Re: help with variables
by Doccie on Sep 8, 2007 at 9:57:33 am

One way of doing this, is using the getURL approach. Using getURL in combination with POST or GET sends -all- the variables that are currently on the timeline (including textfields with variable names), to the url you specified.

Here's an example:
http://pastebin.coconut.se/?id=5550



Respond to this post   •   Return to posts index

Re: help with variables
by rlonac on Sep 8, 2007 at 5:47:50 pm

thanks for the tip. I will try that out.

Respond to this post   •   Return to posts index


Re: help with variables
by rlonac on Sep 8, 2007 at 7:03:48 pm

Hey guys, I tried adding this to the preview button as Doccie said to try:

getURL("http://www.josesmexicanfood.com/ecards/preview.php", "_blank", "POST");

It still doesn't display correctly, though. Here is the php script that handles the preview. I am using swfObect to embed the card on the page.

well, I am new to posting here. I tried to copy the php here but it as not displaying. Anyway I can post the code to help you guys look at?

thanks,

Ryan

Respond to this post   •   Return to posts index

Re: help with variables
by rlonac on Sep 8, 2007 at 7:47:01 pm

Ok, I found out that the variables are not posting.

So I tried moddifying the getURL to:

getURL("http://www.josesmexicanfood.com/ecards/preview.php", "_blank", "GET");

and changed the php to:

$ToEmail = $_GET["ToEmail"];
$FromEmail = $_GET["FromEmail"];
$ToName = $_GET["ToName"];
$FromName = $_GET["FromName"];
$Greeting = $_GET["Greeting"];
$IntroMessage = $_GET["IntroMessage"];
$previewCard = $_GET["previewCard"];

I am still getting an undefined error on the url for the card:

$cardURL = "http://www.josesmexicanfood.com/ecards/"+"";

var so = new SWFObject("", "Your Ecard Preview", "400", "600", "8", "#006633");

Respond to this post   •   Return to posts index

Re: help with variables
by Doccie on Sep 8, 2007 at 9:29:59 pm

If you can and wish... upload your .fla and .php file (rename it to phps so I can view the source, and be sure to take out any sensitive information like server password and such ^^) somewhere and I will have a look. I'm having trouble understanding what you mean. Are the other variables loading now and is it just the one variable that doesn't get passed or do none of the variables work?

Kind regards,
Pieter

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINEDVDsBOOKSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]