[CS3] Sending Flash Variables To Php
I'm trying to send the contents of an input text field to a php script which writes the data to a text file for later use. I'm pretty new too actionscript and php and after hours of looking on the net at tutorials i dont seem to be getting any closer. If someone could have a quick look at my code and tell me what stupid mistakes i'm making it would be a massive help.
I have a text input field on the stage called inputbox1 with a var of var1 i then have a button on the stage with the following code:
on (release) { var send:LoadVars = new LoadVars; loadVars.var1 = inputbox1.text; send.toPHP = "http://www.mysite.om/folder/myphp.php"; }
I then have a php file on my server called myphp.php with this code:
<?php
$f=fopen("data.txt","w"); fwrite($&mydata=$var1); fclose($f);
?>
I have the text file data.txt with &mydata= written inside. This has also been cmoded to 777. All my files are in the same folder and i do have php on the server. So far I cant get anything to work so any help would be greatly appreciated thanks
FlashKit > Flash Help > Flash Newbies
Posted on: 07-01-2008, 08:59 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Sending Variables To PHP, Checking, And Then Sending Back
ok heres the deal:
Im making this email form in flash 2004, and I can get it to send emails and all and great so now im going back and making it error check... so basically it sends out my variables to the PHP file, checks to see if the email is from a real domain among other things, and then depending on what it sends back it will do a certain action... I can get it to send my variables but not sure how to load the variables back in to flash after the calculations are done...this is like my first flash that uses all this so im quite a n00b at it.. thanks
Sending Variables To Flash.
Can you send variables to a flash movie from html, and if yes then how. What I want to do is to tell my movie to go to different frames when the mouse hovers over certain links. Heres the page http://morpheus.terraworld.net/mso
Sending Flash Variables To Asp
I am sending flash variables to an asp page which then links to a database and sends results back. However before i do this i need to upload the asp & database to a windows server. How do i upload them??????
I have coldfussion & apache can i use these instead.
can anyone heeeelllppp or point me in the right direction.
thanx
Sending Variables To Flash
Using Flash 5.0
Is there a way to send variables to flash through another flash player.
The situtaion:
I have a flash movie. It runs sort of like powerpoint where scenes are moved through by a timer. At the start of the movie a variable named
"seconds" holds the number of seconds to display a scene.
Everything works fine.
What i want is another movie that has a button and an input box which when a button is pressed loads the other movie and sets that other movies variable "seconds" to what the input box is.
Is that possible to do in flash. Or do i need something else to do it with?
Sending Variables In Flash 5
I have created a game and at the end there is a section to add a hi- score. I have two variables that I need to send to update the hi- score table. I dont want to get into detail so I just want to know one thing: How do you send variables?
Sending Variables From Flash To Php
yeah sorry folks, I know this subject has been dealth with before but the search function of the forum fails everytime I try...
So the only thing I'm trying to find out is, if it's possible to use the following code in some way, it doesn't seem to work here so I hope you guys know the problem :
Code:
loadVariables("http://www.sin.khk.be/~peterm/sendmail.php?text=text&email=email&name=name", "", "POST");
this should send the vars (from dynamic textfields) to this phpfile and email them to me. the phpfile works, I've tried it with a simple html form.
The site I'm using it for is http://www.avaweb.be
a working form is @ the html section, but you can't mail me using the flash form in the flash section.
Thx for reading,
ava
ASP Sending Variables To Flash MX
I have an asp that receives data from an database and formats the data into the correct format for flash to understand. I am trying to receive data into a flash file to create a bar chart. I am very new at this so let me know if I leave something out. Here is the code.
var sql= Server.URLEncode("SELECT Bank_No, Branch_Name, Sum(case Sub_Account_No when 100 then convert(Avg_Bal_Last_12,sql_numeric) else 0 end) FROM global.DDASummaryView WHERE Load_date='" + sdate + "' and Closed_Flag='2' and Sub_Account_No='100' group by Bank_No, Branch_Name");
var success = GetGraphXML (sql, graphName, Request.Cookies("DQVIstaSessionId8050"));
if (success){
var objXmlData = Server.CreateObject("MSXML2.DOMDocument");
success = objXmlData.loadXML(success.responseXML.xml);
rootNode = objXmlData.documentElement;
if (rootNode.childNodes.length == 0 ){Response.write("We're sorry, no records match your request") ; Response.end }
srcfile = GetBankLogo(rootNode);
// build graphing screen
lastrow = (rootNode.childNodes.length -1)
for (var row = 0; row<=lastrow; row++){
rowNode = rootNode.childNodes.item(row)
dh += rowNode.childNodes.item(1).text
durl += ""
dv += rowNode.childNodes.item(2).text
if (row != lastrow) {dh += ","; dv += ",";durl += ","}
}
Response.write("&dh=" + dh);
Response.write("&dv=" + dv);
Response.write("&Counter=1");
}
else {Response.Write("Unable to load the XML Content ")}
//' chartdata initially contains chart type, colors (dc), labels (dh), values (dv)
chartdata=GetGraphLocation() +"MyExternalchart.swf?&ChartLabels="+dh+"&ChartVal ues=" + dv + "&Counter=1"
then I try to receive these variables with my flash file and I it does not seem to work. Here is the code in the flash file.
Frame 1
var loading = new loadVars();
loading.load("http://test.asp?global.DDASummaryView.Load_Date_0=01/15/2003",0,"GET");
trace("Hello");
trace("ChartValues = " + loading.ChartValues);
trace("ChartLabels = " +loading.ChartLabels);
trace("Counter = " + loading.Counter);
Frame 2
loading.onLoad = function() {
if (loading.Counter == 1) {
gotoAndPlay("end");
}
else {
gotoAndPlay("start")
}
}
Frame 3
var ArrLabel = loading.ChartLabels.split(",");
var ArrValue = loading.ChartValues.split(",");
var ChartData = new DataProviderClass();
for (var i=0; i < ArrLabel.length; i++) {
ChartData.addItem({DataLabel:ArrLabel[i], DataValue:ArrValue[i]});
}
MyChart.setDataProvider(ChartData);
MyChart.setLabelSource("DataLabel");
MyChart.setValueSource("DataValue");
//get Chart title
var ChartTitle
if (loading.ThisChartTitle.length> 0) {
ChartTitle = loading.ThisChartTitle;
}
else {
ChartTitle = "Default Title";
}
MyChart.setChartTitle(ChartTitle);
//get X Axis title
var XAxisTitle
if (loading.XAxisTitle.length> 0) {
XAxisTitle = loading.XAxisTitle;
}
else {
XAxisTitle = "Default Title";
}
MyChart.setXAxisTitle(XAxisTitle);
//get Y Axis title
var YAxisTitle
if (loading.YAxisTitle.length> 0) {
YAxisTitle = loading.YAxisTitle;
}
else {
YAxisTitle = "Default Title";
}
MyChart.setYAxisTitle(YAxisTitle);
-----
Let me know if anyone has any ideas for me.
Smith
Sending Variables From PHP To Flash
Hi there!
I have a main movie in which I load all the parts for my site, also a contact part from which I use flashmailer script with a small php script. It works great if I load the part separately, but when I load it in my main movie, I don't get the "mail sent" message back? It sends the mail ok, but it just says "Contacting server etc""...
I'm loading the part into an empty movieclip called "parts"(which I also load all the other parts in to), and I guess I have to redirect it to my contact movie instead of level 0, but I can't seem to get it right?! I have tried this.loadVariablesNum among other things..
Can anyone help me? Pleesh?
Here is the line i'm concerned with...
loadVariablesNum("php_mail.php" add url_full, 0);
Thanks...
Tom
Flash Sending Variables To Asp
hey guys,
initially we have a normal asp login page for typing in
UserID, Password and 'Type of user'. Upon submitting it will send those 3 fields to a Controller Page before letting the guy in to the page. I'm asked to do a flash loging page to subsitute the asp version, so the question is how do i make my flash page send those 3 fields to the Controller Page?
Also one of my field is a drop down menu, how do we imitate or implement it into Flash?
Sending Variables From Flash To .txt
Alright I was going through the forums and I figured out that I will need a php script to do this however I cannot find out how to manipulate the php script to do what I want and I have no experience with php myself to figure it out on my own.
I have 2 variables that are to be sent to the .txt file but the problem I have is there are multiple txt files I am working with. In my game there a different modes and I have a different .txt for each mode. Instead of making a different send function for each mode I am trying to use a variable for the name of the .txt file. I could make this name a third variable send by flash I guess but how do I tell the php script to load that txt file.
I am using this to assign the variables to be sent:
code:
SendScore = new LoadVars();
SendScore.var1 = Name;
SendScore.var2 = Score;
SendScore.var3 = game+".txt";
SendScore.sendAndLoad("SendScore.php", SendScore, "POST");
Php Sending Variables To Flash
Guys, sorry if this is not the correct area, but i have to ask this:
Can i make a php file that send variables to flash WITHOUT the swf ask for it?
Sending Variables To Flash
Someone please help me with this. I have already read previous threads but can't make any sense of them.
This is what I want...
I have a swf in a html page. On the same page I have a links (whatever1, whatever2, whatever3...) I want to be able to click on the link and send a variable named "whatever1..." to flash and then display it in a dynamic text box. Simple really...
Sending Variables From Flash->Php
Note: Im using Flash 8
Basically, the problem i am getting is flash is executing my php script, but not sending the variables from flash. I used this code on a MC:
code:
on (press)
{
System.security.allowDomain("http://www.xenwars.com");
loadVariablesNum("http://www.xenwars.com/blocks/ngupdate.php", 0, "POST");
_root.gotoAndStop(5);
}
and on ngupdate.php:
PHP Code:
$username = $_POST['username'];
The variable 'username' in flash is defined in the frame on which the MC you press is on. It is simply defined, for testing purposes as such:
code:
_root.username = "Fred";
Any idea whats going wrong? Thanx,
- Aldarn.
Sending Flash Variables To ASP
Is there a way to send variables from a Flash application to an ASP page. Like if I have a form in my flash application that the user fills out. Can I then take those inputs and somehow send it to an ASP page that would process it and store in the DB. I dont have an example to show, just trying to do some research to see if it would work. Thanks.
Sending ASP Variables To Flash
I have a flash site that's embedded in my ASP pages. I'm trying to think of the best way to have my flash web query my asp pages for active variables I have loaded from an access database. Now if there was a logical way that I could just have the movie query the database and grab the info, I'd do that. But is there a way to have my asp pages send actiev variables to my flash movie. Am I on the right track by using this command from my ASP page?
Code:
Response.write "Name=" & Server.URLEncode(usr_username)
usr_username being the variable. And then in my flash movie I'm trying to get the variable to load by using the following:
Code:
onClipEvent(load)
{
CurrentRecord = 0;
onClipEvent(load) ("getvars.asp", this);
}
onClipEvent(data)
{
_global.strName = Name;
}
Am I at all close, or way off, or is this just not possible?
Thanks very much for any help / suggestions / ideas.
Sending Flash Variables To Php
Okay, so I want to have a flash document (test.swf) have a textbox that sends variables to php (test.php) and stores them permanently in a text file (test.txt).
*takes breath*
my code for the flash is:
mydata.text = new LoadVars();
mydata.text.fromflash = textboxbox.text;
mydata.text.send("test.php", "POST");
my code for the php is:
<html>
<head>
<title>PLEASE!!!!!1</title>
</head>
<body>
<embed src="test.swf"></embed>
<font size="20" color="black">
<?php
$variable = $_POST['fromflash'];
$forum = fopen("test.txt", "a+");
fwrite($forum, $variable);
fclose($forum);
?>
-
<?php
echo $variable;
?>
-
</font>
</body>
</html>
and the text file is blank. Please reply!
--Sumwungye
Sending Flash Variables To Php
Okay, so I want to have a flash document (test.swf) have a textbox that sends variables to php (test.php) and stores them permanently in a text file (test.txt).
*takes breath*
my code for the flash is:
mydata.text = new LoadVars();
mydata.text.fromflash = textboxbox.text;
mydata.text.send("test.php", "POST");
my code for the php is:
<html>
<head>
<title>PLEASE!!!!!1</title>
</head>
<body>
<embed src="test.swf"></embed>
<font size="20" color="black">
<?php
$variable = $_POST['fromflash'];
$forum = fopen("test.txt", "a+");
fwrite($forum, $variable);
fclose($forum);
?>
-
<?php
echo $variable;
?>
-
</font>
</body>
</html>
and the text file is blank. My goal is to have the php/html document mirror the Flash textbox. Please reply!
--Sumwungye (Some One Guy)
Sending URL Variables From Flash To Php
I am currently working on an online connect four game where the state of the game needs to be updated after ever move. i've had no problems sending variables from a php script to flash but i'm having difficultly sending variables from flash to php when trying to update a database. i am getting this error message:
The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
To try an understand the process and figure out what i am doing wrong i've stripped down both my actionscript and php files to the bare minimum but still it wont seem to work. here is my actionscript:
Code:
var game_id:String = "1";
var postURL:String = "updateMoveScript.php";
var variables:URLVariables = new URLVariables();
variables.game_id = game_id;
var urlRequest:URLRequest = new URLRequest(postURL);
urlRequest.method = URLRequestMethod.POST;
urlRequest.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, sendHandler);
loader.load(urlRequest);
function sendHandler(evt:Event):void {
var loader:URLLoader = URLLoader(evt.target);
var variables:URLVariables = new URLVariables(loader.data);
}
and here is my php script:
Code:
<?php
$connection = mysql_connect($host, $username, $password);
$select_db = mysql_select_db($database);
//posting game info
$game_id = $_POST['game_id'];
$query = "UPDATE games SET red_state='1' WHERE game_id='$game_id'";
mysql_query($query);
?>
i know the php query is fine as i've tested it by changing the $game_id variable to the value i want to send.
i've tried changing urldataformat from variables to text and also messed about with changing post and get and about every different possible combinations of doing this but with no joy.
i've consulted 3 books and read about 700 other forum posts with people having the same problem but can't find a solution. this is REALLY holding me back and would really appreciate someone pointing out to me where i am going wrong. i know it's going to be a simple mistake, it always is
cheers elliott
Sending Flash Variables To PHP
Hi folks,
I'm trying this for a while now and it's not working.
I'm trying to send a mail from a flash form using PHP.
From now, almost everything is wonderful - i mean, i receive the mail. But for any reason, the variables of the flash movie arent parsed to the php. So what I get is an empty email. I have some words that i placed in my PHP script already thats looks like:
Name:
Email:
etc...
The answers are supposed to be filled using the flash form by the php scrit and then sent to my email. So as i told, I receive the mail, but the answers unfilled.
I jump the validation details of the code to show you the way I post the form to the php script when using a onRelease:
ActionScript Code:
loadVariablesNum ("mailer.php", "0", "POST");
And now, this is a part of the PHP script:
PHP Code:
$EmailBody = "Sent By: $name
Senders Email: $email
Message Sent:
$message";
$name, $email, $message are the variables (or input textfields) of the flash movie.
Now, what I wonder is why i dont get those informations in my mail? I used some ways to see if the variables (name,email,message) are really working inside the flash, and they are. It's really only the way they are sent or parsed to the PHP that isnt working at all.
Is it possible that the level (the "0" in the loadVariablesNum) is making it not to work or something? Or anything else? I'm really confused guys.
Regards,
Sending Variables From Flash To PHP
Hi everyone,
I have a problem while sending variables from flash to PHP
Here is the code:
submit.onPress = function ()
{
c = new LoadVars ();
c.nme = "MyName";
c.sendAndLoad ("getVars.php", Reply, "POST");
}
PHP Code:
<?php
$name = $_POST['nme'];
print "Your name is ". $name . ".<br>";
?>
What am i doing wrong here.
I am getting an error saying Notice: Undefined index: name in xxxgetVars.php on line 5
Please help me. Thanks in advance
Flash And Sending Variables..
ok .. iam trying to append 3 variables to a url that already has 2 variables appended ..
iam using the LoadVars -> "send" method but it wont work. it works if i use a url like "form.aspx" but it wont work if i use "form.aspx?var=nun" which is what i need so i can append 3 more variables to that URL
thanks for the help anyone
-al
Sending Variables PHP To FLASH 8
The following two examples are quite simple and for the life of me I can't figure out what is wrong. I must have spent all of two days unsuccessfully searching the internet for some insight.
Thanxs in Advance: Lastradius
EXAMPLE 1:
Can anybody tell me why the following code reads $fname $lName and $age in the Output Panel of Flash when I'm expecting to see Lazlo Bernini and 36 returned from the php script.
THE SWF FILE
var rData:LoadVars = new LoadVars();
rData.load("external.php");
rData.onLoad = function(){
trace(this.fName);
trace(this.lName);
trace(this.age);
};
THE PHP FILE:
<?php
$fName = "Lazlo";
$lName = "Bernini";
$age = 36;
echo ("&fName=$fName&lName=$lName&age=$age&");
?>
EXAMPLE 2:
Pretty simple, right, the flashCount is sent to the PHP script, iterated, and returned with a value of 2. Only problem is my Output panel simply reads '$phpCount'. I don't have a clue what's wrong!
SWF FILE
var rData:LoadVars = new LoadVars();
rData.flashCount = 1;
rData.onLoad = function() {
var newFlashCount = rData.theCount;
trace(newFlashCount);
};
rData.sendAndLoad("external.php", rData, "POST");
PHP FILE:
<?php
$phpCount = $_POST['flashCount'];
$phpCount++;
echo "&theCount=$phpCount&";
?>
Sending Variables From One Flash To Another?
Hey all.
Here's my goal? I want, when a user clicks on a certain button, that a new browser window opens containing an .swf movie, and that .swf movie loads certain (pics, text, etc) dependent on the variables sent from the original flash movie.
Here's what I've tried so far:
on sending .swf:
CODEtarget_mc.onPress = function() {
getURL("matchdisplay.htm", "_blank");
}
target_mc.onRelease = function() {
sending_lc = new LocalConnection();
sending_lc.send("lc_name", "methodToExecute", match2bigpic[_root.itemchoicenumber]);
}
Sending Variables To Flash
Hi,
is it possible to send a variable to flash via php?
I'm using this code to open a movie in a movie.
------------------------------------
data="main.swf?open=ex.swf"
--
value="main.swf?open=ex.swf"
------------------------------------
inside "main.swf" the code looks like this:
_root.loadMovieNum(_root.open, 10);
Can something like this work to send variables to a movie in a similar way?
Maybe like this?:
$name = $_GET['name'];
-------------------------------------
data="main.swf?open=<?=$name ?>"
---
value="main.swf?open=<?=$name ?>"
-------------------------------------------------------
I've tried a lot but it does'nt seem to work for me. Does anybody know the procedure for this or if it's possible or not?
Sending Variables Out Of Flash
Hi,
I have a simple form where users input their email address and they will hit the submit button and send it to a specified email address. I'm unclear as to the script I need to write to get the info out of flash and to the intended recipient. Thanks for the help!
rdb
Sending Php Variables To Flash
yeh i know this has been covered and i found some search results but i dont think anyone also is trying to do what im trying to do.
first off let me say im no flash expert, i rarely use it. i know what its capable of just i never had the chance to do alot with it. my extent of my knowledge is really just creating buttons and some basic animation stuff and i did something with dynamic text boxes before but forgot how i did it.
EDIT: it turns out i will need to do this whole thing in flash so the ping result can be the time from the clients computer to the server, not from the server of the php script.
so in flash ill need something like
-reads in a list of IPs (perhaps this part should be PHP, just where i put the flashmovie into the page, i beleive there i can pass multiple variables through to flash, which would include a series of IP address)
-flash pings the IPs and stores the results into variables.
-when user clicks different buttons for each IP that was pinged it shows the result into a dynamic text box.
ive been playing around alot and tried googling stuff, i feel like im doing it all wrong maybe someone could point out what commands would be used to do this stuff so i can atleast know what to research.
Flash Chatroom - Sending Variables
I'm new to this action scripting stuff so this could be really simple.
I've got a flash movie that monitors a txt file on the server and updates it ever 2 seconds to show whats being said. the txt file is updated by a perl script, which all works fine, but i want to make it more complex by incorporating the input box into the flash movie. at the moment its in a seperate browser frame.
i want to know the AS i need to send the data from a 'input text box' that is contained in a movie clip, to the PERL. i know i'll have to change the PERL but that will be easy, i also want to send the data when the ENTER button is pushed.
Any help would be appreciated, thanks
** Problem W/ Sending Variables To/from CGI And FLASH
I have a section of ActionScript in Flash5 that calls a PERL CGI script. The PERL script performs a series of SQL queries and returns a value of 'true' or 'false'. Based upon this returned value, I want Flash to execute different tasks.
My problem is that I can't seem to get Flash to notice the returned value from my PERL script. I have tried making the PERL script write to a txt file (value.txt) with the following format: value=true and then using loadVariables("value.txt",0) but to no avail.
I also tried using OnClipEvent(data) but it gives me an error message when I export the movie stating that the function can only be used in a movie clip, whereas all of my code is enclosed in a on(release) of a button.
Please help! Thanks!
TigerPalm
Sending Variables From Html To Flash
I'm stuck!
I'm currently making a html-site in dreamweaver.
It consists of 2 frames; one frame with an html-content, and one frame
where I want to show Flash-anims.
I want the flash movie to respond to the links in the html-frame.
is it possible?and if is,are the method compatible with a wide range of
browsers?
petter
Sending Flash Variables To Generator
In flash 5 have a button on a current generator movie to open a new generator movie in level 1....the script is:
on (release) {
fvar = "{gvar}";
queryString = "?newgvar=" & fvar;
loadMovie ("zzz.swf" & queryString, 1);
where fvar is set to an existing generator variable and the 'newgvar" will be used in a new generator template in the insert jpeg file name attribute as {newgvar}....
why the hell aint this working?
[Edited by mothguy on 01-12-2002 at 12:53 PM]
Sending Variables From Javascript To Flash
Here's the problem. I'm using this javascript:
function somefunctionname(){
var ident=document.flashname
ident.SetVariable("variable",'value');
}
It works just fine in older Netscapes, and IE. For some reason it does not work in The latest versions of Netscape and Mozilla. (Netscape 6.2.3 and Mozilla 1.1 beta)
I get:
"Error: ident.SetVariable is not a function"
The flash is embedded with the needed properties:
ID="flashname"
NAME="flashname"
swLiveConnect="true"
If you want to see a live example of this code and its problems, view http://www.Exavior.com The flash remote sends javascript commands to turn the flash TV on and off, as well as mute.
I went to http://www.macromedia.com/support/fl...ts/tn4160.html
Where they describe the process, but even THEIR javascript does not seem to work with the newer versions of Netscape or Mozilla.
Any ideas what might be causing this problem?
/Exavior
[Edited by Exavior on 08-24-2002 at 07:55 AM]
Flash Sending Wrong Variables
using loadVars: when I send variables the queryString looks like this
C%3A%5CDocuments%20and%20Settings%5Cchadams1%5CMy% 20Documents%5CMy%20Pictures%5Cchadhome%2Ejpg
but sending the same variables using a html form has a differnt look, like this
C%3A%5CDocuments+and+Settings%5Cchadams1%5CMy+Docu ments%5CMy+Pictures%5Cchadhome.jpg
notice how the jpg has a period in front of it
my form works fine as html but I'm trying to convert it so you can send from flash using sendAndLoad method of the loadVars object. and it doesn't work
does anyone know why flash does this?? I think it's screwing up sending these variables.
Sending Variables To Flash From Html
Hi all!
Wondering how i send a variable to flash via html or javascript. I need an if statement at the beginning of my timeline so that when a certain variable is sent across from the web page, the flash movie starts at a different point, depending on which variable is used.
This is so the swf can be started from specific places in the time line, which is sepcified by the user on the html page. Any hints?
k8
Sending Variables To Another Flash Movie?
Hi,
I need to be able to get some data entered by the user into a format for easy printing.
ie. five different input boxes with text in each.
I need to get the information into a page in portrait format.
Can i popup another flash movie in another window and send the variables to that?
or even send them to a html page?
If so, any help would be greatly appreciated.
Thanks in advance,
Ian
Trouble Sending Variables From Flash To PHP
I am trying to pass variables from Flash to PHP and back and I am having trouble. I am using the "loadVariablesNum("testagain.php", 0, "POST");" to post information out of Flash to a php file in the same directory. All the script does is it spits back some text to flash with the variable in that text. But all it does is spits back the text with the variable name "$name" as if it never receive the variable from Flash to begin with. I know that Flash is seeing the php file because it pulls back the text from the PHP file.
I am running PHP on my local machine and I have these php and flash files inside of the apache folder, if that makes a difference.
Thanks.
Sending Variables From 1 Flash File To Another
Hello community
I actually joined Flashkit a long time ago, (Back with flash 3 / 4 days) but I've been out of flash for awhile. (School and work), but I recently started dabbeling in flash again. (Flash 7 MX) ... so I'm VERY rusty.
Newho .. basically my problem goes as follows:
I have a page with 3 frames, the top and bottom frames contain .swfs.
I want to send a global variable from the bottom .swf to the top frame, which contains another .swf.
does anyone know a command for me to do this? I've tried looking up all sorts of stuff, but I mostly get stuff about PHP etc.
- Id
[CS3] Sending Variables From Flash To Web Browser...
Okay so here's the problem...
I need to have an action that will return a variable when a button is pressed. That variable then needs to be sent to the browser, load another URL, and then be available to another SWF.
I have been trying to do this unsuccessfully using getURL using both GET and POST. I can get the variable to post to the URL, but the URL shows up looking like this:
http://www.jamesman.com/hope_test/ww...niHeader%2Eswf
So you can see that the URL is writing to the string twice; then the variable is tagged onto the end. I don't know why my script is doing that. Here's the script:
var headerName:String = "miniHeader.swf";
minNav1_mc.onRelease = function(){
_root.getURL("www.jamesman.com/hope_test/minichurch.html", "_self", "GET");
}
Ultimately, I need the variable contained within the onRelease function, but for now, I'll just settle for the URL string working correctly!
Thanks for you help!
Sending Variables Wirhin Flash?
OK!
I have a main.swf(level0) movie that loads other movies: content1.swf(level1) and menu.swf(level2).
When someone clicks on a button, let´s say "About", of the menu.swf I want to do some actions: play, asign a value to a certain variable (var menu="about.swf") and when it reaches another frame I want some action like this:
on (release) {
tellTarget ("_level1") {
gotoAndPlay("goaway");
}
var menu = "about.swf";
}
The movie at level 1 will reach a frame with another action like:
loadMovieNum("the value of the variable <<menu>>", 1);
so it translates to
unloadMovieNum(2);
loadMovieNum("about.swf", 1);
So I´m using on level1 a variable originally declared at level3. Do I need to send it? or it will be read as a local variable?
What would be the sintaxis of the latest action?
Would it be
loadMovieNum(menu, 1);
????
I will really appreciate any help!
P.S. Sorry about my english!
Sending Variables From Flash To Php Script?
Help! im trying to send some variables from an swf to a simple php script and then send them back. Currently im using an input field called input....and an output field called output (good naming!) in flash.....u type in a word in the input field and click send button which does this =
on (release) {
loadVariablesNum("http://MYDOMAIN/phpinfo.php", 0, "GET");
}
the php looks like this =
<?php
//THIS JUST ADDS SOME TEXT TO THE VARIABLE
$input.=" from php"
//THIS CREATES THE VARIABLE TO BE DISPLAYED IN THE DYNAMIC TXT FIELD CALLED OUTPUT BACK
IN FLASH
$output= "output=$input";
echo $output;
?>
It doesnt seem to work...cant anyone see where im going wrong?
thanks
Sending Variables From Director To Flash
I am trying to pass a variable from director to an embedded flash movie. All the online documentation I've found says how to pass variables from flash to director, but nothing from director to flash. Can anyone help?
Thanks!
Sending Variables From Flash To Php In Background
im trying to send variables from flash to php in the background without reloading
here is my code
Code:
on(release) {
if(_root.main.right.news_sign.newsletter.text.indexOf("@") != -1 && _root.main.right.news_sign.newsletter.text.indexOf(".") != -1) {
_root.main.right.news_sign.check_text.text = "";
varsToSend = new LoadVars();
varsToSend.newsletter=_root.main.right.news_sign.newsletter.text;
varsToSend.sendAndLoad("email.php",this.varsToSend);
gotoAndPlay(2);
}else {
_root.main.right.news_sign.check_text.text = "Please Enter Valid Email";
}
}
but it works standalone... doesnt work in browswer.. anyone know why?
here is my php code
PHP Code:
<?
$ToEmail = "info@me.com";
$ToSubject = "Newsletter signup";
$EmailBody = "Sent By; $newsletter";
$success = mail($ToEmail,$ToSubject, $EmailBody, "From:".$newsletter." <".$newsletter.">");
if($success) {
echo sucesss;
}
?>
oh yea! it shouldnt pop up a window and tahts why im usng sendAndLoad and not send
please help
Flash Form Sending Variables
OK. Im in at the deep end guys & I need your help.
I am a novice flasher and i know my limits but I am building a site at work at the moment & just found out I have to integrate a registration form (actually, two registration forms, one for students one for teachers) into it.
Rather than using the php tutorial on here, I have to take whats entered into the fields & send them to eloqua which is the system they use for database & tracking emails etc.
The info I got from eloqua is
Quote:
//SEND DATA - Take usual flash form and pass Eloqua hidden fields and flash fields using Eloqua form information ==============================
var sendData = function(){
var EloquaVars = new LoadVars();
EloquaVars.elqFormName = 'Axios_Form_Name_Here';
EloquaVars.elqSiteID = 'Axios_Site_ID_Here';
EloquaVars.defaultTargetURL = '';
EloquaVars.elqPost = '';
EloquaVars.eloquaFieldName = flashName.text;
EloquaVars.sendAndLoad("http://now.eloqua.com/f.asp", EloquaVars, "POST");
gotoAndStop("End");
}
And now Im not sure what to do. Can anyone help? i would very very much appreciate it!
I have attached the fla file in case someone can help. Thanks in advance!
@#{^[(§# Flash - Sending Variables With Loadmovie
Why does everything in Flash have to be such a pain in the ***? You think you're going to do something simple in 5 seconds of typing, but half of the times it turns out you're wasting hours searching for a way around some stupid restriction of flash.
This time I made a movie that uses some variables that are specified in the .html (FlashVars). Sending these variables from html to the flash movie is no problem.
But I tried to see if my movie still works when it's loaded into a holder movieclip. So I use the following code to load the movie and send the same variables to it:
PHP Code:
mc_holder.loadMovie("imageviewer.swf?width=700&height=350&imageList=afbeeldingen.txt&settings=ivsettings1.xml");
Should be easy enough, but it doesn't work.
Quote:
Error opening URL "file:///D|/%5FOPDRACHTEN/%5FIMAGEVIEWER/ImageViewer/imageviewer.swf? width=700&height=350&imageList=afbeeldingen.txt&se ttings=ivsettings1.xml"
So I tried this:
PHP Code:
mc_loader.width="700";mc_loader.height="350";mc_loader.imageList="afbeeldingen.txt";mc_loader.settings="ivsettings1.xml";mc_loader.loadMovie("imageviewer.swf", "GET");
Which returns this:
Quote:
Error opening URL "file:///D|/%5FOPDRACHTEN/%5FIMAGEVIEWER/ImageViewer/imageviewer.swf? width=700&height=350&imageList=afbeeldingen%2Etxt&settings=ivsettings1%2Exml"
(notice the %2E where a period should be)
When I leave out the variables like this, it loads the movie, but without the variables of course.
PHP Code:
mc_loader.loadMovie("imageviewer.swf");
Anybody have an idea on how to find a way that works?
Please!
Sending Variables From Flash To Php In Background
im trying to send variables from flash to php in the background without reloading
here is my code
Code:
on(release) {
if(_root.main.right.news_sign.newsletter.text.indexOf("@") != -1 && _root.main.right.news_sign.newsletter.text.indexOf(".") != -1) {
_root.main.right.news_sign.check_text.text = "";
varsToSend = new LoadVars();
varsToSend.newsletter=_root.main.right.news_sign.newsletter.text;
varsToSend.sendAndLoad("email.php",this.varsToSend);
gotoAndPlay(2);
}else {
_root.main.right.news_sign.check_text.text = "Please Enter Valid Email";
}
}
but it works standalone... doesnt work in browswer.. anyone know why?
here is my php code
PHP Code:
<?
$ToEmail = "info@me.com";
$ToSubject = "Newsletter signup";
$EmailBody = "Sent By; $newsletter";
$success = mail($ToEmail,$ToSubject, $EmailBody, "From:".$newsletter." <".$newsletter.">");
if($success) {
echo sucesss;
}
?>
oh yea! it shouldnt pop up a window and tahts why im usng sendAndLoad and not send
please help
Sending Flash Variables Into A Database Via Asp?
no problem fishing info out of a database and using it within flash, but i can't get around the great big error message of "getInfoError" when i try to send info back to the asp script. anybody know where i might be going wrong??
here's the as function:
************************************************************
function sendGameInfo() {
sendvars = new LoadVars();
sendvars.onLoad = function(result) {
if (result) {
records = sendvars.records;
trace("records = "+int(records));
} else {
trace("getInfoError");
}
};
totplayers = int(homeplayers)+int(awayplayers);
sendvars.totloop = totplayers;
v1 = eval("sendvars.batpos");
v1 = batpos[0];
v2 = eval("sendvars.batruns");
v2 = batruns[0];
//sendvars.sendAndLoad("senddata.asp", sendvars, "POST");
}
************************************************************
and here's the asp script:
************************************************************
response.write "records=4"
rs.close
totloop = request.form("sendvars.totloop")
batpos = request.form("sendvars.batpos")
batruns = request.form("sendvars.batruns")
************************************************************
if i just opt to receive the "records" variable without attempting to send anything, there's no problem. i've got to use the "eval" function (i suppose) as i eventually want to loop through the arrays.
this is seriously doing my fruit now, so if anyone has a notion, i'd be pleased to hear it,
thanks for reading (and hopefully helping),
ralph
Sending Variables To Flash After Loading
Hi there,
I have a flash movie which is already loaded. Now I need to send a variable to this Flash movie on click of an HTML link. Does anyone know how to do this without reloading the entire page?
Basically I have a navbar on top(HTML) and then the flash movie below. Depending on which link is clicked in the navbar I need the flash movie to behave a certain way, without reloading tha page.
thanks for any help!
Flash And PHP Sending Variables To Database
I've made a game that works fine. I want to add a "send score" button that send the variable (score) to a php file which then will insert the variable into the database. And if it works to go to a frame that says "Score Sent!" and if it doesn't then "ERROR: Score not sent!". I've never done this before, could anyone please guide me through this step by step? Thank you so much.
|