Receiving variables back from php
basicaly i have narrowed it down to this code
stop();
////// Assign a variable name for our URLVariables object
var variables:URLVariables = new URLVariables();
var varSend:URLRequest=new URLRequest("create_member.php");
varSend.method=URLRequestMethod.POST;
varSend.data=variables;
//////// Build the varLoader variable
var varLoader:URLLoader=new URLLoader ;
varLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
trace(varSend.data.status);
trace(varLoader.data.status);
As silly as it sounds, i need the trace to see the error.
I am using cs4 for this and have not found anything so far to explain why it is not working.
You can test it out without needing anything on stage.
This is the error i get and do not know why.
undefined is the varSend trace
TypeError: Error #1010: A term is undefined and has no properties.
at Untitled_fla::MainTimeline/frame1() is the varLoader trace
I need this fixed, but cant find why it is doing it. Any ideas would be greatly accepted.
There is a full script as well, but I still only get the errors stated. Basicaly I am unable to get any variables back from PHP. They show up an a standard browser window, but that is no good to me. My site is 100% flash and i need to receive data so that i can log people in, retreive their names and info, send custome messages to people on the site or even if only visitors. Without flash seeing the data correctly, I cant do squat.
if (event.target.data.returnBody=="") {
output_txt.text="No data coming through";
} else if(event.target.data.returnBody!=="") {
output_txt.condenseWhite = true;
output_txt.htmlText = ""+ event.target.data.returnBody;
gotoAndStop("_end");
trace(varLoader.data.status)
If i only use -- event.target.data I do get the info in, but with all the mish-mash that comes with it
e.g.
%0A%20%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%3Ch2%3EOne%20Last%20Step%20%2D%20Activate%20through%2 0Email%3C%2Fh2%3E%3Ch4%3EOK%20peter%2C%20one%20last%20step%20to%20verify%20your%20email%20 identity%3A%3C%2Fh4%3E%3Cbr%20%2F%3E%0D%0A%20%20%20In%20a%20moment%20you%20will%20be%20sen t%20an%20Activation%20link%20to%20your%20email%20address%2E%3Cbr%20%2F%3E%3Cbr%20%2F%3E%0D %0A%20%20%20%3Cbr%20%2F%3E%0D%0A%20%20%20%3Cstrong%3E%3Cfont%20color=%22%23990000%22%
Similar Messages
-
Special characters in String variable sent from php.
Hello. Assuming that I send some String variable from php into flash:
AS3:
var MyImportedString:String;
var variables_page_text:URLVariables = new URLVariables();
var varSend_page_text:URLRequest = new URLRequest("MyPHP.php");
varSend_page_text.method = URLRequestMethod.POST;
varSend_page_text.data = variables_page_text;
var varLoader_page_text:URLLoader = new URLLoader;
varLoader_page_text.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader_page_text.addEventListener(Event.COMPLETE, var_comp_page_text);
varLoader_page_text.load(varSend_page_text);
function var_comp_page_text(event:Event):void {
MyImportedString = event.target.data.MyVariable;
php:
<?php
header('Content-Type: text/html; charset=utf-8');
$MyString = "some tekst &";
print "MyVariable=" . $MyString;
?>
I've noticed that the special character '&' residing inside String, throws an error: #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
My first thought was, it has something to do with html entities, but other entities (like <> or ") don't throw any error. Besides, the use of php functions like htmlentities(); or html_entity_decode(); doesn't make any difference in this case:
print "MyVariable=" . htmlentities($MyString);
or
print "MyVariable=" . html_entity_decode($MyString);
I've also noticed that characters like '%', '^', '+' don't show up at all;
What does it mean? Any ideas?
Reagards.Thank You 'moccamaximum'.
Ok. So here is the solution (php function posted by 'moccamaximum' does the trick):
AS3:
var MyImportedString:String;
var variables_page_text:URLVariables = new URLVariables();
var varSend_page_text:URLRequest = new URLRequest("MyPHP.php");
varSend_page_text.method = URLRequestMethod.POST;
varSend_page_text.data = variables_page_text;
var varLoader_page_text:URLLoader = new URLLoader;
varLoader_page_text.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader_page_text.addEventListener(Event.COMPLETE, var_comp_page_text);
varLoader_page_text.load(varSend_page_text);
function var_comp_page_text(event:Event):void {
MyImportedString = event.target.data.MyVariable;
trace(MyImportedString); // Output: some text &%^+
php:
<?php
header('Content-Type: text/html; charset=utf-8');
$MyString = "some text &%^+";
print "MyVariable=" . flash_encode($MyString);
function flash_encode($string){
$string = rawurlencode(utf8_encode($string));
$string = str_replace("%C2%96", "-", $string);
$string = str_replace("%C2%91", "%27", $string);
$string = str_replace("%C2%92", "%27", $string);
$string = str_replace("%C2%82", "%27", $string);
$string = str_replace("%C2%93", "%22", $string);
$string = str_replace("%C2%94", "%22", $string);
$string = str_replace("%C2%84", "%22", $string);
$string = str_replace("%C2%8B", "%C2%AB", $string);
$string = str_replace("%C2%9B", "%C2%BB", $string);
return $string;
?> -
We are currently outsourcing 3rd party payroll to ADP. Master Data and Time Wage Type IDOCs are transmitted. After payroll processing, G/L data is downloaded through ADP Infolink G/L interface website as a .csv file.
We want to receive G/L data back from ADP in standard SAP IDOC format. I have posed this question to ADP support with no luck.
Has anyone imported G/L net payroll data back from ADP as an IDOC? Is this considered a different product than web-based Infolink G/L?
thanks,
EricHello Eric,
We are currently in the process of implementing ADP and do master data transfer from HR to ADP.
Would you be willing to have a quick phone call with me interms of lessons learned and advice from you on this.
Please let me know.
Thanks,
Girish -
Strange variables retrieved from php script
Hi,
I am experiencing a really strange thing when making my flash
movie communicate with a php script.
No matter what the animation is doing, just consider the
following :
see code below
ticket is the object which receives the response from server
which returns
echo utf8_encode("reponse=ok")
Each time when I run it , (ticket.retour.toString() != "ok")
returns true, and the redirection url shows the following :
http://xx.yy.zz.uu/jeu_avertissement.php?type=PROBLEME_CONNECTION&retour=ok&d=0.02&u=1&k=7 39f4db19af87cc0f2b72a6f63698500
showing value of my retour var which is equal to .... ok
I really don't understand! Could anybody explain me what
happened. It looks like I saw a UFO.
Thanks in advance,
PascalDamn it i found :D
i had to write :
for (i=0; i<_root.tab_result.liste_lenght; i++) {
myCB.addItem(_root.tab_result['ville'+i],_root.tab_result['ville'+i]);
I just hope it could help someone else ahahha
Bye ;)
Séb. -
Creating a array from variables passed from php
I have passed variables from PHP to flash successfully but
now need to firstly make them into an array. A next button and
previous button has to trigger the step through the array.
Any ideas?I have a PHP script and I get flash to load the variables
from it. The code is as follows. Taken out the connection to DB for
security.
<?php
$hostname_conn = "";
$database_conn = "";
$username_conn = "";
$password_conn = "";
// establish a SQL connection to the host - host, user, pass
$conn = mysql_pconnect($hostname_conn, $username_conn,
$password_conn) or trigger_error("The site database appears unable
to provide a connection. Please contact support.
".mysql_error(),E_USER_ERROR); // or die("The site database appears
unable to provide a SQL connection. Please contact support.");
// connect to the right DB (there may be multiple db's on the
server) dbName
mysql_select_db($database_conn, $conn) or die("The site
database appears to be unavailable. Please contact support.");
$qCheck = "SELECT * FROM pics";
$rsCheck = mysql_query($qCheck) or die("Check Failed :
".mysql_error());
$cCheck = mysql_num_rows($rsCheck);?>
&img=<?php
while($row= mysql_fetch_assoc($rsCheck))
print($row["img"]);
?> -
Sending variable value from php to flash to load an xml file
I would like to load an XML file from the location locally or on the server being unaware of the name of the file. I am using PHP for sending the filename to Flash.
The below is the PHP code:
<?php
filesInDir('C:\Documents and Settings\457305\My Documents\shrikant\Flash Tutorials\webassist');
function filesInDir($tdir)
$dirs = scandir($tdir);
foreach($dirs as $file)
if (($file == '.')||($file == '..'))
elseif (is_dir($tdir.'/'.$file))
filesInDir($tdir.'/'.$file);
else
echo "fileName=$file";
?>
And below is the loading Actionscript code:
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.net.URLVariables;
stop();
// Define the PHP file to be loaded
var phpFile:String = "http://localhost/webassist/test.php";
var cons_xml:XML;
var xmlLoader:URLLoader = new URLLoader();
// Specify dataFormat property of the URLLoader to be "VARIABLES"
// This ensures variables loaded into Flash with same variable names
xmlLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
xmlLoader.load(new URLRequest(phpFile));
xmlLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(evt:Event):void
trace(evt.target.data.fileName);
//cons_xml = new XML(evt.target.data.fileName);
//gotoAndPlay(2);
When I trace the evt.target.data it displays "fileName=mainOpenEndedXML%2Exml" and when I trace evt.target.data.fileName the fileName is properly displayed as "mainOpenEndedXML.xml".
But in the next two lines where the loading occurs it does not load the file i.e the swf file from xml doesn't play.
I have been searching the Internet for answers but not able to find any solutions.
The loading works properly if i directly insert the xml file in the code and the swf's in the XML file play propertly. The below is the code for the same:
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.net.URLVariables;
stop();
var cons_xml:XML;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("mainOpenEndedXML.xml"));
xmlLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(evt:Event):void
cons_xml = new XML(evt.target.data);
gotoAndPlay(2);
Any help on this would be greatly appreciatedYes. you already said that, but I guess you don't understand what I said. You are loading the PHP fle to get the filename, but nowhere are you taking that filename and loading the file that was named.
You need to do two loading operations. The first one to get the filename, and the second to load the file with that name. Maybe if you name the PHP file loader phpLoader instead of xmlLoader it will start to make more sense to you. Something like the following...
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.net.URLVariables;
stop();
// Define the PHP file to be loaded
var phpFile:String = "http://localhost/webassist/test.php";
var phpLoader:URLLoader = new URLLoader();
// Specify dataFormat property of the URLLoader to be "VARIABLES"
// This ensures variables loaded into Flash with same variable names
phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
phpLoader.load(new URLRequest(phpFile));
phpLoader.addEventListener(Event.COMPLETE, processPHP);
function processPHP(evt:Event):void
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest(String(evt.target.data.fileName)));
xmlLoader.addEventListener(Event.COMPLETE, processXML);
var cons_xml:XML;
function processXML(evt:Event):void
cons_xml = new XML(evt.target.data);
gotoAndPlay(2); -
Want to Receive Response Back From SOAP
Hi ,
My Scenario is IDOC-XI--SOAP
Iam sending the IDOC from R/3 and want to hold the Response message from SOAP like "Success or Fail".
I want to the response message in XI itself, no need to reach the response even to R/3.
How can we achive this
Regards
SumanIDOC: Import it as Imported Object -->When you define the namespace of swc in IR select you can import Idocs and RFC option and complete the textbox with correct information
SID (system ID)
Client
Later you import the Idoc, doble click on it a export it to your driver, next import it as External Definition for reason in my previous post.
Create a SWC type B_ in SLD and define it as dependence of A_. later import it into IR. there define the Data Type and Message Type for genericResponse.
How you will use (maybe) this structure en many interface is the reasson you define it into B_XXXX
*Basis Products (B_): Ideal for templates, generic structures, shareable java programs, etc.
Canonical Definitions(C_): For generic business objects, meant to be reused.
Exchange Infrastructure Application Products(A_): These products represent XI objects other than interface objects (e.g. Mappings, Integration Processes, etc).
Interface Products( I_ ): Represent extensions to current application. These are the extensions we will later import in Exchange Infrastructure (XI) and associate the corresponding interface objects and integration scenario actions.*
h1IRh1
Web Services
Import your WS as external definition into IR
Message Interface
Define a Message Interface type abstract and sync.
............Request Message (External Definition Idoc)
............Response Message ( genericResponse)
Define a Message Interface type abstract and async.
............Request Message (External Definition Idoc)
Define a Message Interface type abstract and async.
............Response Message ( genericResponse)
define them in A_
Define a Message Interface type inbound and sync.
............Request Message (Request WS)
............Response Message (Response WS )
Message Mapping
Create a Message Mapping for Request
Create a Message Mapping for Response
Interface Mapping
Import MI(abstract) of IDOC
Import MI of WS
select the mapping for request and response Tab
BPM
1)in container window define a variable named IDoc_ABS with category abstract interface and type (select the MI of IDOC alone)
define a variable named GenericRespnse_abs with category abstract interface and type (select MI of genericResponse alone)
2)create a Recieve Step --> in property message select the container you define before of idoc.
3) define a Send Step--> mode synchronous
select MI type abstract and sync (idoc and genericResponse)
for property request message selects container Idoc_ABS
for property response message selects container GenericRespnse_abs.
Save your Changes and thats all for BPM
h1IDh1
it is too much complicated to explain, lets try
Create scenario
Assign BS and create comunication channels with QoS (quality of service) type BE
Import your BPM
Create a Receiver Determination
-->in the target service select the BPM. Save
-->In overview windown at foot windowns select MI IDoc_abs only. nothing else
Create a Receiver Determination
-->here the system who send data is BPM
-->in the target service select the BS of receiver system.Save
-->In overview windown at foot windowns select interface mapping and assing communication channel
what we do here. the flow is next
1)receive data from sender system and send it to BPM
2)BPM call bs of target system (WS). how? because in interface determination you selected before the interface mapping
hope you can understand and be useful -
AS3 send/import variables to/from php file
Hi
im new I would like to send some variables from ac3 to a
php-file. the
php-file have to copperate with this variable (send
querystring to
mysql-server).
ac3 have to read then new variables and traced it on the
screen.
i found some examples on the net but i have not undersood
any.
can you please explane that to me????
SebastianHi
im new I would like to send some variables from ac3 to a
php-file. the
php-file have to copperate with this variable (send
querystring to
mysql-server).
ac3 have to read then new variables and traced it on the
screen.
i found some examples on the net but i have not undersood
any.
can you please explane that to me????
Sebastian -
Try to sync computer. Have not received email back from Firefox.
Still waiting for email to verify sync...
HI cunfla,
You open the manage account and resend the verification email? Please also check your email filters to make sure it did not get stuck in spam. -
Hello, I want to instruct a server-side PHP script to
generate a dynamic PDF using variables I submit from Flash.
I then want to download that PDF back into my Flash
application.
Can I use "Loader" or "URLLoader" ?
If so, how do I structure my code to render the PDF within
Flash when it comes back from PHP ?
...or do I have to use Flash Remoting or other means to
achieve my goal ?
Thanks for any help.thanks, but is there a way to bring the PDF into Flash, so I
can manipulate it's position etc. ?
Flash remoting perhaps ?
Thanks for any help. -
Receiving xml file from B2B - assign the data to a variable
Hi,
I am receiving an xml file from B2B and assigning the file content to a variable.
I have a B2B adapter - mediator - bpel process. In the bpel process I am assigning the inputVariable to a userdefinedvarible.
But I am not getting the value correctly. Only the root tag of the xml is shown as the value for the userdefinedvarible.
In the composite audit level,
<process>
<scope name=main>
receiveInputreceiveInput
Sep 17, 2010 9:31:10 AM Received "inputVariable" call from partner "processorder_client"Received "inputVariable" call from partner "processorder_client"
View XML Document (******* the xml doc shows the complete xml********)
Assign_1Assign_1
Sep 17, 2010 9:31:10 AM Updated variable "Order"Updated variable "Order"
<payload>
<Order>
<orders/> (******* the variable shows only the root element********)
</Order>
Sep 17, 2010 9:31:10 AM Completed assignCompleted assign
Sep 17, 2010 9:31:10 AM BPEL process instance "40004" completedBPEL process instance "40004" completed
I have connected the mediator interface to bpel interface and did not do any other special config? Is that ok?
Can anyone please tell me the procedure to assign the xml file content from a b2b message to a bpel variable Or direct me to any samples on this?
I dont understand if the prob is in mediator or assigning? I do see the inputvariable having the complete xml...!!
Thanks in advance.
GaneshHi Ganesh,
Might be problem with the parts.
receiveInputreceiveInput
Sep 17, 2010 9:31:10 AM Received "inputVariable" call from partner "processorder_client"Received "inputVariable" call from partner "processorder_client"
View XML Document (******* the xml doc shows the complete xml********)Check the part in the xml and part you defined for inputvariable.
Regards
PavanKumar.M -
Flash Builder 4.5 for PHP - show variable from PHP in app
I have searched for hours and I can't figure this out…
Is there a way to somehow "echo" my PHP code in my MXML file ?
I know you can't echo something from PHP to MXML, so here's what I have done :
I get my informations from my database, I need to show an image and its title, so I put the following code in a variable :
<mx:Image id="laniraBlanche" x="25" y="65" width="210" height="126" source="'.$row->image_mini.'" click="selectLaniraBlanche()" rollOver="seePicture()" rollOut="outPicture()" /> <s:Label x="25" y="155.85" text="'.$row->nom.'" width="210" textAlign="center" height="37" fontSize="19" backgroundColor="#676666" verticalAlign="middle" fontFamily="Georgia" color="#FFFFFF" click="selectLaniraBlanche()" rollOver="seePicture()" id="laniraBlancheTxt" rollOut="outPicture()" />'
Then, I return that variable.
I find the function where my var created is returned from the "Data/Service" tab, I am on Design mode on Flash Builder, and I "drop" my function where I want my image and text to show on my app.
I tryed dropping it in a "group", it doesn't show anything. I tryed several other options, and nothing worked.
So my question is, how could I have this code created in PHP show on my application ?
Thank you for your helpI also have Flash Builder 4.5 for PHP and the ANT view does not show when going to Window -> Show View --> Other. I could not find it in any of the folders.
However, I was able to add it by hitting Command 3 (CTRL 3 on PC) and typing Ant. -
Is there anyway that I can receive my money back from a recent purchase download
Is there anyway that I can receive my money back from a recent purchase download
You can try contacting the support staff for the stores at http://www.apple.com/emea/support/itunes/contact.html but reportedly, if they grant that it is a one time only event.
-
Cannot pass variables from PHP to actionscript 3.0
I am using CS3 and I write the following code as to pass variable to flash from PHP
Actionscript
var myLoader:URLLoader = new URLLoader();
myLoader.dataFormat = URLLoaderDataFormat.TEXT;
var myRequest:URLRequest=new URLRequest("http://localhost/moodle/value.php");
myLoader.load(myRequest);
myLoader.addEventListener(Event.COMPLETE,onCompleteHandler);
var myValue: String;
function onCompleteHandler(e:Event):void{
var myvariable: URLVariables = new URLVariables(e.target.data);
myValue = myvariable.values;
trace(myValue);
PHP file
<?php
echo ('values = 8');
?>
But I always get the error and cannot get the values by using trace();
Before i try to use "myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;" I still get the same error.
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables$iinit()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
Can anyone help me?The error is fixed.The new version is like that
Actionscript
var myLoader:URLLoader = new URLLoader();
myLoader.dataFormat = URLLoaderDataFormat.TEXT;
var myRequest:URLRequest=new URLRequest("http://localhost/moodle/value.php");
myLoader.load(myRequest);
myLoader.addEventListener(Event.COMPLETE,onCompleteHandler);
var myValue: String;
function onCompleteHandler(e:Event):void{
var myvariable: URLVariables = new URLVariables(e.target.data);
myValue = myvariable.values;
trace(myValue);
php file
<?php
echo "values=8";
?>
The output finally is "null" in flash file. Why does it happen? It should give me 8 when I input trace(myValue); -
have received an email from apple to say my ID has been used to download an emoticon package for £15.99 - it was not me. is there a way to find out which device it is? and to get my money back? ta
It is a phishing attempt. Do not respond. Do not divulge any personal or financial information. You can use the address below to forward the suspect email message to Apple.
[email protected]
The link below has information to help identify fraudulent emails.
http://support.apple.com/kb/HT4933
Maybe you are looking for
-
Cannot print a web page that prints fine in IE9
I'm trying to print a web page in Firefox, but when I do the print preview it has web info at the top of the page but the rest is blank, the second page displays just fine, then all the other pages behind it are completely blank. If I try to print a
-
Change Web Template by URL/JS in WAD
Hello everybody, imagine you have embedded a web template (T_EMBEDDED) in a web template (T_MAIN). Now you want to substitute T_EMBEDDED with T_EMBEDDED2 in T_MAIN with JavaScript by SAPBWOpenURL(..). How would you do this? Thanks in advance. Greetin
-
Book marks bar disappeared suddenly
Hello, I am using Safari 5.1 on OS 10.6.8 and suddenly while opening a new window the book marks bar disappeard. I restarted the system but it is not coming back. In the safari preferences, the options for bookmarks bar and menu are enabled and in sp
-
Concurrent nodes reading from JMS topic (cluster environment)
Hi. Need some help on this: Concurrent nodes reading from JMS topic (cluster environment) Thanks Denis
-
i just consolidated 3 firewire drives of my samples down to 1. since the when i boot up ,when it gets to updating tree, logic crashes. i unmounted samples drive and it still crashes at updating tree. any ideas on how to remedy this? what is updating