Send Variable From ASP to Flash to ASP
I'm really, really new to Flash and using Flash 8 Pro. This
is what I'm trying to do. I have a list of cars, when someone
clicks on a car, they are taken to a page with details about the
car and a flash gallery. The Flash Gallery is reads the image files
names from an xml file. I'm really using an asp file (photos.asp).
Anyway, I need the pass photos.asp the vin of the car from flash.
I did this is the VehicleDetailSaleen.asp screen
<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
width="600" height="530">
<param name="movie"
value="photogallery.swf?VIN=<%=(Recordset1.Fields.Item("VIN").Value)%>">
<param name="quality" value="high">
<param name="VIN"
value="<%=(Recordset1.Fields.Item("VIN").Value)%>">
<embed
src="photogallery.swf?VIN=<%=(Recordset1.Fields.Item("VIN").Value)%>"
width="600" height="530" quality="high" pluginspage="
http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash"
vin="<%=(Recordset1.Fields.Item("VIN").Value)%>"></embed>
I just don't know how to catch it in the flash file and send
it back....
#include "scripts.as"
LoadVars;
loadPhotoXML("Photos.asp?VIN="+ this.vin);
mclThumbnails.onEnterFrame=function(){
thumbnailsRoll()
function loadPhotoXML(filename:String):Void {
photoXML.ignoreWhite = true;
photoXML.load(filename);
photoXML.onLoad = function(success:Boolean):Void {
if (success) {
photoNumber = 0;
rootNode = this.firstChild;
totalPhotos = rootNode.childNodes.length;
for (var i = 0; i<totalPhotos*2; i++) {
if (i<totalPhotos) {
thumbnails
= rootNode.childNodes.childNodes[0].firstChild.nodeValue;
url
= rootNode.childNodes.childNodes[1].firstChild.nodeValue;
titleText
= rootNode.childNodes.childNodes[2].firstChild.nodeValue;
} else {
thumbnails
=
rootNode.childNodes[i-totalPhotos].childNodes[0].firstChild.nodeValue;
url =
rootNode.childNodes[i-totalPhotos].childNodes[1].firstChild.nodeValue;
titleText
=
rootNode.childNodes[i-totalPhotos].childNodes[2].firstChild.nodeValue;
thumbnailsLoad(i);
checkProgressLoad(0);
caption.text = titleText[0];
Please, I know I don't know anything, but I've been reading
forums for 2 days and everyone seems to have a different idea but I
don't really understand them. I just need a simple, do this, then
this sort of help.
Thanks,
Heather
heatherlsi. anyway you can post your resulting code? having
probelm with writing a Flash to ASP script... thanks
Similar Messages
-
Send data from c# to flash
Hi,
I know that is possible to send strings from and to flash in
c# with the fscommand-function.
But is it possible to send a kind of dataset or array(list)
to flash?
Grtz
Annihil8>>Are you hosting a flash player within a c/c++
program?
No, they are seprate bascially i am trying to send data to a
seprate c/c++ file.
>>need more info about what you're trying to do
>>and why before we can give you an answer
I have liitle flash programme that I have built that acts
like a language book (something for GCSE revision) for french and
german (so far i have only built the german). Because you have to
type in your oen answer, it had to be long term so i couldn't use
Shared Objects and so i wanted flash to create a new file so
on the owners pc as i don't really have that much mermory on my
server. I know that flash was not able to create a file so i looked
at different scripts.
I have not decided weather it will be downloaded or it runs
in a pop - up browser or in the browser; so i want to keep it as a
.swf for now. I knew that c/c++ did what i want but how do you get
it onto the server and work? (i decided i have to get it working on
the server first before i do anthing else).
EDIT: just remembering something. flash is going to send an
array to c++ which will write over that array in file. I probabl
have separate all the arra that is going to be edited?
Thanks for your reply as well
at least it looks like one person knows of
c/c++ -
Passing variables from PHP to Flash
I have a contact form that works. The user enters their info,
hits submit, and their info is emailed to me. I need to figure out
how to have the PHP script send back a confirmation that the email
was actually sent. I can't get the php to echo just a "yes" or
"no". Here is what I have so far:
Flash code to bring in PHP variable to notify user if mail
has been sent or not:
function receive_response(e:Event):void
var loader:URLLoader = URLLoader(e.target);
var email_status = new URLVariables(loader.data).success;
if(email_status == "yes")
status_txt.text = "Success! Your message was sent.";
timer = new Timer(500);
timer.addEventListener(TimerEvent.TIMER, on_timer);
timer.start();
else
status_txt.text = "Send failed! Please email or call us";
and here is my entire PHP Code. The code in bold at the bottom
is where it is supposed to pass the "yes" or "no" as the variable
success
<<meta http-equiv="content-type"
content="text/html;charset=utf-8">
<?php
// Create local PHP variables from the info the user gave in
the Flash form
$senderName = $_POST['userName'];
$senderEmail = $_POST['userEmail'];
$senderMessage = $_POST['userMsg'];
// Strip slashes on the Local variables
$senderName = stripslashes($senderName);
$senderEmail = stripslashes($senderEmail);
$senderMessage = stripslashes($senderMessage);
$to = "info@*******.com";
// change this to reflect your site
$from = "contact@*********.com";
$subject = "Contact from ***********.com";
//Begin HTML Email Message
$message = <<<EOF
<html>
<body bgcolor="#FFFFFF">
<b>Name</b> = $senderName<br /><br />
<b>Email</b> = <a
href="mailto:$senderEmail">$senderEmail</a><br
/><br />
<b>Message</b> = $senderMessage<br />
</body>
</html>
EOF;
//end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$to = "$to";
if (mail($to, $subject, $message, $headers))
echo “success=yes”;
else
echo “success=no”;
exit();
?>
ThanksI have a contact form that works. The user enters their info,
hits submit, and their info is emailed to me. I need to figure out
how to have the PHP script send back a confirmation that the email
was actually sent. I can't get the php to echo just a "yes" or
"no". Here is what I have so far:
Flash code to bring in PHP variable to notify user if mail
has been sent or not:
function receive_response(e:Event):void
var loader:URLLoader = URLLoader(e.target);
var email_status = new URLVariables(loader.data).success;
if(email_status == "yes")
status_txt.text = "Success! Your message was sent.";
timer = new Timer(500);
timer.addEventListener(TimerEvent.TIMER, on_timer);
timer.start();
else
status_txt.text = "Send failed! Please email or call us";
and here is my entire PHP Code. The code in bold at the bottom
is where it is supposed to pass the "yes" or "no" as the variable
success
<<meta http-equiv="content-type"
content="text/html;charset=utf-8">
<?php
// Create local PHP variables from the info the user gave in
the Flash form
$senderName = $_POST['userName'];
$senderEmail = $_POST['userEmail'];
$senderMessage = $_POST['userMsg'];
// Strip slashes on the Local variables
$senderName = stripslashes($senderName);
$senderEmail = stripslashes($senderEmail);
$senderMessage = stripslashes($senderMessage);
$to = "info@*******.com";
// change this to reflect your site
$from = "contact@*********.com";
$subject = "Contact from ***********.com";
//Begin HTML Email Message
$message = <<<EOF
<html>
<body bgcolor="#FFFFFF">
<b>Name</b> = $senderName<br /><br />
<b>Email</b> = <a
href="mailto:$senderEmail">$senderEmail</a><br
/><br />
<b>Message</b> = $senderMessage<br />
</body>
</html>
EOF;
//end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$to = "$to";
if (mail($to, $subject, $message, $headers))
echo “success=yes”;
else
echo “success=no”;
exit();
?>
Thanks -
Send data from html to flash action script
Hi,
I would like my flash to act differently depending on what
html page it is on. Can I send information from html code to action
script?Hi,
Yes you can, by using FLASHVARS. Refer the attached code for
example. Also you can use Javascript setVariable method of Flash
object to set values in between i.e. after the page has loaded, as
in case of FLASHVARS these are sent to flash just at the begining
i.e. once SWF loads. In the attached exmple i've sent 2 variables
to Flash one is 'username' and other is 'userId', thse will be
fetched inside flash movie as _root.username and _root.userId.
Note: I've added flashvars as PARAM and also as an attribute
for EMBED tag (used by Mozilla, NS etc)
Hope this helps.
Thanks,
Sumeet -
How to pass a variable from HTML to Flash
I have built my flash ad banner in Flash 9 and now want the
HTML code to pass the url over to the flash movie that it should
jump to when clicked.
The info in the help file seems out of date for the latest
HTML template as it uses mainly JavaScript to get round IE's
dreadful embeding issue. So my problem is, how do I pass a variable
from the HTML to the actionScript specified int he Help file
(running on a full screen button) as shown below?
myButton_btn.onRelease = function() {
if (clickTAG.substr(0, 5) == "http:") {
getURL(clickTAG);
via the html code now used by Flash 9 which is like this:
<!-- saved from url=(0013)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Advert_long</title>
<script language="javascript"> AC_FL_RunContent = 0;
</script>
<script language="javascript"> DetectFlashVer = 0;
</script>
<script src="AC_RunActiveContent.js"
language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 115;
// -->
</script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
Coping
with
Growing
Audio
Series
Theraputic stories
for children aged
4 to 9
-->
<script language="JavaScript" type="text/javascript">
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion,
requiredMinorVersion, requiredRevision);
if(hasRightVersion) { // if we've detected an acceptable
version
// embed the flash movie
AC_FL_RunContent(
'codebase', '
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
'width', '120',
'height', '600',
'src', 'Advert_long',
'quality', 'high',
'pluginspage', '
http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Advert_long',
'bgcolor', '#ffffff',
'name', 'Advert_long',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'Advert_long',
'salign', ''
); //end AC code
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be
placed here.'
+ 'This content requires the Adobe Flash Player.'
+ '<a href=http://www.macromedia.com/go/getflash/>Get
Flash</a>';
document.write(alternateContent); // insert non-flash content
// -->
</script>
<noscript>
// Provide alternate content for browsers that do not support
scripting
// or for those that have scripting disabled.
Alternate HTML content should be placed here. This content
requires the Adobe Flash Player.
<a href="
http://www.macromedia.com/go/getflash/">Get
Flash</a>
</noscript>
</body>
</html>You should use SWFObject to embed your Flash. Not only does
it make
embedding more straightforward, it makes passing query
parameters very easy.
Check out:
http://code.google.com/p/swfobject/
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
How to pass a variable from HTML to Flash 9
I have built my flash ad banner in Flash 9 and now want the
HTML code to pass the url over to the flash movie that it should
jump to when clicked.
The info in the help file seems out of date for the latest
HTML template as it uses mainly JavaScript to get round IE's
dreadful embeding issue. So my problem is, how do I pass a variable
from the HTML to the actionScript specified int he Help file
(running on a full screen button) as shown below?
myButton_btn.onRelease = function() {
if (clickTAG.substr(0, 5) == "http:") {
getURL(clickTAG);
via the html code now used by Flash 9 which is like this:
<!-- saved from url=(0013)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Advert_long</title>
<script language="javascript"> AC_FL_RunContent = 0;
</script>
<script language="javascript"> DetectFlashVer = 0;
</script>
<script src="AC_RunActiveContent.js"
language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 115;
// -->
</script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
Coping
with
Growing
Audio
Series
Theraputic stories
for children aged
4 to 9
-->
<script language="JavaScript" type="text/javascript">
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion,
requiredMinorVersion, requiredRevision);
if(hasRightVersion) { // if we've detected an acceptable
version
// embed the flash movie
AC_FL_RunContent(
'codebase', '
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
'width', '120',
'height', '600',
'src', 'Advert_long',
'quality', 'high',
'pluginspage', '
http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Advert_long',
'bgcolor', '#ffffff',
'name', 'Advert_long',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'Advert_long',
'salign', ''
); //end AC code
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be
placed here.'
+ 'This content requires the Adobe Flash Player.'
+ '<a href=http://www.macromedia.com/go/getflash/>Get
Flash</a>';
document.write(alternateContent); // insert non-flash
content
// -->
</script>
<noscript>
// Provide alternate content for browsers that do not
support scripting
// or for those that have scripting disabled.
Alternate HTML content should be placed here. This content
requires the Adobe Flash Player.
<a href="
http://www.macromedia.com/go/getflash/">Get
Flash</a>
</noscript>
</body>
</html>You should use SWFObject to embed your Flash. Not only does
it make
embedding more straightforward, it makes passing query
parameters very easy.
Check out:
http://code.google.com/p/swfobject/
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
How to send Variable from a web dynpro abap application to anthor
HI all:
I have two web dynpro abap applications .
I want to send a Variable from a web dynpro abap application to another web dynpro abap application using post method.
Because, now I have used append_field_url to send Variable,but this method will display the Variable in the URL.
I do not need this result.
I need the Variable from a web dynpro abap application to another web dynpro abap application and the Variable will not display in the URL.
Can you give me an example?
Thanks.HI Nawal Kishor Mittal :
I have tried your method,but I can not get the value of variable.
My code is as follows:
The first web dynpro abap application:
DATA:BEGIN OF l_send,
l_value TYPE string,
END OF l_send.
l_send-l_value = '400001'.
EXPORT l_send-l_value FROM l_send TO SHARED MEMORY indx(aa) ID 'YTEST_MATNR'.
The second web dynpro abap application:
DATA:BEGIN OF m_send,
s_value TYPE string,
END OF m_send.
IMPORT m_send-s_value TO m_send FROM SHARED BUFFER indx(aa) ID 'YTEST_MATNR'.
DELETE FROM MEMORY ID 'YTEST_MATNR'.
Thanks. -
Passing a variable from text to flash
How do you pass a variable from a text file to flash?
Check out Help for loadVariables.
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
Passing variables from php to flash and the opposite
Hi guys, im trying weeks now to solve this problem but nothing yet
If someone could just tell me how to pass variables from flash to php and the opposite i would be thankful!!! Please help!I have recently had to learn this, so this may not be the best way but it worked for me
I suggest looking at the code below stripping out everything you don't need (e.g. the databse stuff) and just get a simple string going back and forward
have a go and post any problems here and I'll try and help
in flash i have
private function getBalanceAndXP():void
var request:URLRequest = new URLRequest("utils.php");
request.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.func = "getBalance";
variables.fbid = userID;
request.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, onBalanceComplete);
loader.load(request);
private function onBalanceComplete(e:Event):void
var loader:URLLoader = e.target as URLLoader;
loader.removeEventListener(Event.COMPLETE, onBalanceComplete);
var variables:URLVariables = new URLVariables(loader.data);
_balance = parseInt(variables.balance); // class variable
_experience = parseInt(variables.experience); // class variable
public function setBalanceAndXP(balance:int, experience:int):void
_balance = balance;
_experience = experience;
var request:URLRequest = new URLRequest("utils.php");
request.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.func = "setBalance";
variables.fbid = userID;
variables.balance = _balance;
variables.experience = _experience;
request.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.load(request);
and then I have my php file
<?php
$func = $_POST["func"];
$fbid = $_POST["fbid"];
$balance = $_POST["balance"];
$experience = $_POST["experience"];
$numVariables = 0;
$link = mysql_connect("localhost","username","password");
mysql_select_db("databaseName");
if ($func == "getBalance")
getBalance($fbid);
else if ($func == "setBalance")
setBalance($fbid, $balance, $experience);
mysql_close($link);
function getBalance($fbid)
$query = "SELECT balance, experience FROM tableName WHERE fbid = '".$fbid."'";
$result = mysql_query($query);
$row = mysql_fetch_row($result);
writeVariable("balance", $row[0]);
writeVariable("experience", $row[1]);
function setBalance($fbid, $balance, $experience)
$query = "UPDATE tableName SET balance = ".$balance.", experience = ".$experience." WHERE fbid ='".$fbid."'";
mysql_query($query);
function writeVariable( $name, $value )
global $numVariables;
if ( $numVariables > 0 )
echo "&";
echo $name . "=" . urlencode($value);
$numVariables++;
?> -
Load variables from XML into Flash
I was wondering how to load variables from an XML document to
a Flash file? I am familiar with the code to do it for a text file,
but was wondering how to do it for XML.
Many thanks in advance!
JJThanks for the recommendation on the site. What I am trying
to do is load varaibles from an XML file into text boxes in my
flash movie.
Here is my loading:
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){
if (success) {
gotoAndStop("slide01");
my_xml.load("narration.xml");
this is what I have on my frame with the text boxes (the text
boxes are also have the variable name in the variable area)
var narration = my_xml.picture01;
var my_title = my_xml.my_title;
var my_date = my_xml.my_date;
should I do my_date.text = my_xml.my_date; instead?
my xml doc looks like this
<?xml version="1.0" encoding="iso-8859-1"?>
<picture01>This is the text for picture
01</picture01>
<picture02>This is the text for picture
02</picture02>
<my_title>Las Vegas</my_title>
<my_date>October</my_date>
Any help on this would be GREATLY appreciated!
Text
my_date.text = my_xml.my_date; -
Need help sending variables from HTML to SWF...
I have a header with tab buttons--- When you are on a certain
page the coorisponding tab is a different color(as a locator).
Right now I have like, 7 or 8 different headers that are the
same thing minus the colored tab of the current page.
Is there a way to code the flash so that I only need one
header, but still keep the off-colored buttons when on the
coorisponding page?
Apparently, from what I have gathered I need to Send a
variable to the SWF from the embedding HTML using FlashVars or
SWFObjects' 'addVariable' method etc so the SWF knows which
tab/color to use.
But, I have no ideal where to start...uugggggg.
Any Suggestions????
I really, really need to figure this out.
Thanks in advance,
hutchthe easiest way to pass vars to the flash is by appending
them to the url of the flash:
e.g your swiff is called "mymovie.swf" and you want a
parameter "color" to be available on the _root level of your movie,
so all you have to do is embed the flash with the following url
into your html page:
"mymovie.swf?color=black"
now back in flash you can get the value of "color" like this:
in _root timeline:
color
in any other timeline:
_root.color
the value will be filled once the movie is called from within
the HTML as explained above -
How to send variable from vision builer to robot?
hi all,
i have a project with vision builder that generate variable of position.these varible i want to send it to a robot.it is possible to send it directly from vision builder to the robot or i must to send varible ti labview firstly then to robot?
best regarsHi,
Yes, you can send it directly to the robot using TCP/IP protocol:
Vision Builder can be a server or a client. You can send data in string format or in raw format.
Kind regards,
Nikita.
Did you know LabVIEW can control industrial robot arms? - www.digimetrix.com -
Passing dynamic variable from html to Flash
I know this is pretty simple but all that I have read doesn't make much sense to me. I have one swf calling another swf that I have embedded into an htnl. In other words just calling another html page in a seperate window.
In one.swf (runing in broswer) I use the below to call another html page passing the variable NewLessonArray. This contains an array of completed chapters.
// LOADING URL
var NewLessonCompleteArray:String = LessonCompleteArray.toString();
navigateToURL(new URLRequest("two/index.html?CurrentLessonInfo=<NewLessonCompleteArray>"), "_blank");
In the receiving swf I want to retrieve the passing parameters.
two.swf
// Getting the parameters passed
this.loaderInfo.parameters.toString()
All that is returned that I can see is object Object. But since I am passing on a address line into another swf embedded in a html page I am unable to determine that correct syntac for retrieving the information.
Any suggestions? This has got to be pretty simple... I think.
THANKSWhat you are trying to do is not extremely difficult to do, but it is not something I would consider as being simple. With Andrei's approach you should be able to take the url String and dissect the parameters from it using String methods, like split().
As for the loaderInfo end of things, you are not passing the parameters to the swf file, you are passing them to the html page. So the loaderInfo won't have any info for you regarding the url parameters. The loadInfo would typically get parameters via the FlashVars parameters passed in in the html's swf embedding code.
Here are some other solutions that you might consider. I have not dealt with these myself, they are merely in my collection of useful info, so you might have to experiment to get them working. One is a link to a class-based approach and the other is an approach that use swfObject embedding to dynamically add the parameters as FlashVars to the embedding code....
http://mikethenderson.com/2009/02/as3-return-query-string-value-version-2/#more-105
OR
In your HTML:
var flashvars = {};
if (swfobject.getQueryParamValue("aParameter")) {
flashvars.param = swfobject.getQueryParamValue("aParameter");
swfobject.embedSWF("myMovie.swf", "myContent", "550", "400", "9.0.0", "", flashvars);
And the param variable will be available as a FlashVar to your movie:
var theParam = loaderInfo.parameters.param; -
Passing variable from php into flash, help please
Here are what I'm having:
<?PHP
$testVal = "This is a test";
$test = urlencode($testVal);
$out = "test=". $testVal;
echo $out;
?>
// and this is my flash file
function getData() {
// Prepare request
var urlReq:URLRequest=new URLRequest("http://localhost/test.php");
urlReq.method=URLRequestMethod.GET;
var loader:URLLoader = new URLLoader();
loader.dataFormat=URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, completeHandler);
loader.load(urlReq);
function completeHandler(evt:Event) {
var vars:URLVariables = URLVariables(evt.target.data);
trace(" TEST = ", vars.test);
trace(" TEST = ", unescape(vars.toString()));
// and below is the ouput
TEST = undefined
TEST = test=This is a test
I've tried with several different ways to get ONLY the value of the variable - that means I only want to have "This is a test" returned, but I either got "undefined" or the whole thing "test=This is a test", instead.
I'm new to Flash and PHP. Please help.
ThanksThere's no need to write any fake variables out, Flash does not need that. OK, here's a simple PHP script like yours - I called it test.php
<?PHP
$testVal = "This is a test";
$out = "test=". $testVal;
echo $out;
?>
And the AS to call it:
var myLoader:URLLoader = new URLLoader();
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
myLoader.load(new URLRequest("http://www.mydomain.com/test.php"));
myLoader.addEventListener(Event.COMPLETE, dataLoaded, false, 0, true);
function dataLoaded(e:Event){
trace( e.target.data.test);
You will see 'This is a test' traced to the output window.
HTH -
Passing variable from html to flash
Hi I have built a flash movie with buttons...depending on
which button is clicked it loads a different flash movie due to
variable setting. I am able to set and call the variable s in flash
fine
But now i have an html page that needs to blend with this
flash...So i created buttons on my html page to look like the
flash...But when i click a certain button i want it to know the
variable going into the flashpage and load correct movie...not just
go to the beginning of my flash movie then user will have to choose
the button again...
How can i do this?
thank you in advance
renowell, between the post to forum and this link below i got
this to work for me
Just needed to know about the javascript....along with
putting the value/variable in url as posted..thanks
http://noscope.com/journal/2003/12/query_string
thanks for replying with suggestions!
reno
Maybe you are looking for
-
ITunes on Windows Vista PC can't connect to AirPort Express. PC returns error message -15000
I'm running PC with Vista and newest update iTunes. I have set up a network through my AirPort Express, and i am streaming music wirelessly from my PC to AirPort. This used to work, but now i get an error message saying that an error occured while co
-
Help guys! I cracked the glass under my pad 2 as it fell down when I was on a moving bus. I wonder if the apple stores in singapore will help to replace it as I got it for only about 2 to 3 weeks..which is still under the warranty. What should I do?
-
Sidebar favourites start to point at wrong drive randomly and I have no idea why?
I have 3 firewire drives connected to my iMac, "Media Drive", "Media Drive Mirror" and "Media Drive Mirror 2". Media Drive is my primary work drive and the other two are mirrored backups. I have links to my working directories on the primary drive in
-
Centered flash site with no margins
I was wondering if any one could help me in "coding" my site to have my flash page be centered and have NO margins.... I know Kirupa.com had a code on his site in regards to some code to be placed in the "head" tag of the .html "page" but it has sinc
-
Inserting calculated fields in database queries
I have just changed from using StarOffice version 7 to version 8. I am having difficulties in creating a calculated field in a query. Would anyone have some ideas for me to follow? Thanks - Dan