ActionScript 2.0 :: Send A Variable From Swf To A PHP And Echo It
Feb 15, 2011i am trying to send a variable from my swf to a PHP and echo it.
[Code]....
i am trying to send a variable from my swf to a PHP and echo it.
[Code]....
ActionScript 3 can send UDP packets via flash.net.DatagramSocket. Is their any way to send an ICMP packet? I'd also like to set the TTL flag so I can implement traceroute in an SWF.
View 1 RepliesI want to be able to retrieve several variables from my MySQL database. Currently my flash sends a request to .php file which then echos all of the variables as a single string. Flash picks up the string using
[Code]...
I brought a pre-built shopping cart and I'm trying to put some buttons in another MC but when I click them the cart don't update.
The original setup of the cart was:
The 'Add to cart' buttons are on the root and the cart was inside an MC also on the root.
Now I understand that it's not not working due to me moving the buttons into a MC.[code]...
I've got a flash course that needs to pass the current screen number from the course to the mySQL database. The person who built the back-end built a php page that I can pass the number to and it will get written to the db but I'm not sure how to "send" that in the background.He told me that I just need to call the index.php page like: [URL]So, would I use URLRequest for something like that?
Code:
var vars:URLVariables = new URLVariables();
vars.theData = data;
var req:URLRequest = new URLRequest("www.url.com/index.php/user/bookmark/"+slideNum);
[code]....
I'd like to be able to generate certain data XML file through PHP based on variable that embedded in html page swf sends or request. I heard that it can be achieved by assigning FlashVars. I created a flash gallery which loads all content based on data from XML. However, I need to load a different content using the same flash gallery based in which html page the swf(gallery) is embedded. I can generate new XML through PHP if swf will send a variable to PHP which can be read as unique. I need to create a mechanism where the embedded swf send this unique variable.
View 10 Repliesusing Flash CS5, writing in Actionscript 2:This script works:
Actionscript Code:
get_ecard.onRelease = function(){ my_vars = new LoadVars(); my_vars.firstname = name_txt.text; if (my_vars.firstname != "")
[code].....
Basically I am trying to send a variable from flash to php, I was trying to do it through the sendToURL function, because this seemed to be the most appropriate way to do this, although I may be wrong. Below is the AS.
var quizVariables:URLVariables = new URLVariables();
quizVariables.party = "labour";
var myURLRequest:URLRequest = new URLRequest(".../partyhandler.php");
myURLRequest.data = quizVariables;
sendToURL(myURLRequest);
Once this is done it should cause the following PHP to run (which works fine if I manually type in the address eg .../partyhandler.php?party=labour)
$party = $_GET['party'];
mysql_query("UPDATE party SET $party = $party+1 WHERE id=1");echo $party;
however something seems to not be working with the flash element of the code.
i want to make a swf ecard. the swf will include an input text for a message + input text for sender email adress + recipient email adress.the swf will send variable to php with random name + email to recipience with message that inform bout an ecard sent to them + specific url.
View 2 RepliesI have a html form and when submit is clicked, my php processes the data. At the moment its simple, just one field displayed to the screen <?php echo htmlspecialchars($_POST['name']); ?>.Instead of doing this, I want to send the variable name to a swf file, and load the swf file with the name. I will use flashvars to do this. I have seen examples, and I think this one is used to display the swf onto the webpage, and pass the data to the swf.
<object width="540" height="240" title="sample">
<param name="movie" value="card.swf" />
<param name="flashvars" value="var1=here&var2=are&var3=my&var4=flashvars" />
<embed src="card.swf" flashvars="var1=here&var2=are&var3=my&var4=flashvars" type="application/x-shockwave-flash" width="540" height="240" ></embed>
I am not sure what it is really doing, and what I should change the value to in order for my name variable to be passed.
I am creating avatar for website. After selecting avatar it store to the database and how can send it as php variable.
View 4 RepliesI'd like to be able to generate certain data XML file through PHP based on variable that embedded in html page swf sends or request. I heard that it can be achieved by assigning FlashVars. I created a flash gallery which loads all content based on data from XML. However, I need to load a different content using the same flash gallery based in which html page the swf(gallery) is embedded. I can generate new XML through PHP if swf will send a variable to PHP which can be read as unique. I need to create a mechanism where the embedded swf send this unique variable.
View 3 RepliesI'm trying to send one variable from flash to php and the see it again in flash but still can't get it work
here is my FLA
and the php code is exactly like this:
[Code]....
I have a search field in flash, it has a text box with a variable name. When the user clicks the search button, I need to send whatever is in that text field to something called 'search.cfm' . I am unfamiliar with any sort of backend coding, but I am hoping this is a fairly basic thing to do.
View 1 RepliesAnd i m struggling for this past 5 days without knowing the solution AS3 script
i wanna send a dynamic variable from flash to php... this work gr8 flash file
[Code]....
in this php file i want to change "$i" dynamically. which the data from from flash should update. i dnt know how to do. when i give 2 then database should fetch fp_id =2, if i give 1 ishoud get fp_id 1.
I have the following classes:Parent (Document class for parent.swf)Child (Document class for child.swf)Parent successfully loads child.swf as a MovieClip.I am unable to communicate with the child from the parent. I want to send variables to the child.
View 4 RepliesI want to send a variable to javascript, then in the javascript for it to take that flash variable and then evalute it using an if statement. Can I use the loadvars command?
[Code].....
is there a way to send a php variable to flash?I have found on the web some examples using GET... Is using GET the only way?
View 2 Replieshow i can send value to variable from variable arguments???
PHP Code:
var num:Number=0
function ff (e:Number):void {
e=55
}
ff(num)
trace(tt)//0
I've been trying to communicate flash and javascript some time now, but I can't get Javascript to send variables to flash, just the other way around. When the .swf is done loading, it succesfully triggers the "isReady" function in Javascript, but when i try to trigger the "sendToFlash" function in Flash(via javascript), nothing happens.
"thisMovie("myID").sendToFlash(toFlash);" this is the code I can't get to work, as you see I tried these to as well;
document.getElementById("myID").sendToFlash(toFlas h);
document["myID"].sendToFlash(toFlash);
nothing triggers the code.
JAVASCRIPT
Code:
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
[code]....
create and send a variable called "return." But that conflicts with a word used in actionscript.[code]is there anyway to work around this naming conflict?
View 1 RepliesI did the following in passing several multiple to flash[code]...
ReferenceError: Error #1069: Property var1 not found on String and there is no default value.
Is there anything wrong in my php code or in the actionscript? How should I pass multiple variable to flash?
i wanna send a dynamic variable from flash to php.[code]in this php file i want to change "$i" dynamically... which the data from from flash should update.when i give 2 then database should fetch fp_id =2, if i give 1 ishoud get fp_id 1.
View 0 RepliesI have 3 buttons on the stage, all of them set in the library to have a base class of Btn.
I want to send a url link to each button so it knows where to go when clicked.[code]...Send variable to extended mc on stage?
How can I with the html-code include a variable that you can take out in flash?
PHP Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash
[Code]....
Also, just a little variable. (xmlfile=text.xml) (I want to have the same swf-file but use it in several html-files (and I have one xml-file to every html-file))
I have an email form that I'm sending to a PHP script. It's basically two variables, one for the senders email, and one for the message. They are both within a movieclip called 'form', and they are working with this code...
on (release) {
// send variables in form movieclip (the textfields)
// to email PHP page which will send the mail
_level2.form.loadVariables("email.php", "POST");
[code].....
I use level2 because this whole email form is being loaded onto level2 of my flash site.What I'm trying to do is to send the _global.var_name to the PHP as well. It represents a makeshift radio button selection....and when I trace it, it works.But either it's not sending over there, or I'm doing something wrong with the syntax, or I'm not receiving it properly.On the PHP side....I'm using...
$message = $_POST["message"];
$message .= "
" . $_POST["_global.var_name"];
And it isn't working.
i m using as3 for my project
URLRequest("new.swf?abc="+1);
im sending my varaiable like this call a swf and sending variable... and i dont konw hoe to get the sent variable from file 1.
I want to send some varibale to asp.net page and from there to SQL DB.
how to send the variable to asp.net?
I'd like to be able to generate certain data XML file through PHP based on variable that embedded in html page swf sends or request. I heard that it can be achieved by assigning FlashVars. I created a flash gallery which loads all content based on data from XML. However, I need to load a different content using the same flash gallery based in which html page the swf(gallery) is embedded. I can generate new XML through PHP if swf will send a variable to PHP which can be read as unique. I need to create a mechanism where the embedded swf send this unique variable.
View 3 RepliesI wrote a little test program to learn about mySQL integration in Flash. The program looks as: I have one button and one dynamic text field. If I hit the button, as3 starts an URLRequest to a php file which then connects to a mySQL database. The requested variable is send to as3 and displayed in the text field. Up to this point, everything is working fine. But when I hit the button again, after I updated my db, the text field still shows the old value. Although it should output the current value.
So, here's my as3 code:
mButton.addEventListener(MouseEvent.CLICK, onSQL);
function onSQL(e:MouseEvent):void {
var varSend:URLRequest = new URLRequest("[URL]");
varSend.method = URLRequestMethod.POST;
var varLoader:URLLoader = new URLLoader;
[Code] .....
I really don't know, why the program is not updating the value.