ActionScript 3.0 :: Send Value From Function To Variable?
May 14, 2011how 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
how 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 have the class with builder and methods. Can i send function to a builder of class as a variable? I want to set individual functions for some samples of class.
View 1 RepliesI am trying to send a value from one of my xml nodes (<marker>) by declaring it in a function 'showData' as a variable 'XMLMarker'. If I trace this value (XMLmarker) it returns the right data found in the node <marker> (which is 'myMarker_mc'). However, I need to tell the stage that myMarker_mc is a MovieClip...please see the 'PROBLEM' stated in the code below.
[Code]....
I have a public variable and I am trying to set it, then read it from a different function:
public var str:String;
public function DailyVerse()
{
function create() {
[Code]....
My trace results says null. Why does it not give me "hello"?
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 Repliesi am trying to send a variable from my swf to a PHP and echo it.
[Code]....
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 Replies