Groups | Blog | Home
all groups > flash (macromedia) > may 2004 >

flash (macromedia) : Simple PHP to flash Variable HELP!


Fatrick P
5/13/2004 10:32:30 PM
I am trying to carry a simple variable from PHP into a dynamic text box in
flash, but I just don?t seem to get it. Could some one please walk me through
the easiest way to do this?

My form and PHP code looks like this:
<form action="test3.html" method="get">
<input name="trans" type="text"><input type="submit" name="Submit"
value="Submit">
</form>

<?
if ($trans==""){
print " ";
}else{
echo "&text2=".$trans;
}
?>

My flash movie is one frame long with an action layer and a text layer. In the
text layer I have a dynamic text box with the variable name of textbox.

The action layer has the script of:
textbox.onLoad = text2;

Can someone PLEASE walk me through what I am doing wrong? Thank you

Engan
5/14/2004 4:00:08 PM
check this out:

//Till flash programmet, variabel namn
print "<br>&entries="; //THIS LINE IS FOR PRINTING THE VARIABLE NAME TO THE
FLASHMOVIE SO U CAN ACCESS IT!
for($i = 0; $i < $numallComments; $i++) {
$array = mysql_fetch_array($allComments);
$comments = mysql_result($allComments, $i, 'comments');
$time = mysql_result($allComments, $i, 'time');
print '<strong><font face="Verdana" size="18pt"><p><b>Datum: ' . $time .
'</b><br>' . $comments . '</p><br></font></strong>';
//U CAN FORMAT THE TEXT IN .PHP FILE AND SET THE TEXTAREA TO ALLOW .HTML
FORMAT IN THE PROPERTY INSPECTOR
//FOR THE TEXTAREA
}//end for

THIS IS THE ACTIONSCRIPT FOR A TEXTAREA:
function loadEntries() {
// Begin Loading
myEntries = new LoadVars();
myEntries.ref = this;
myEntries.load("http://engan.kicks-ass.net/gif/Klubben.php");
myEntries.onLoad = function(success){
if(success){
KLtext.text = this.entries; <----- THIS IS THE VARIABLE PRINTED BEFORE THE
FOR-LOOP in .phpfile
}//end if
else{
KLtext.text = "Failed myEntries(onload)!!!";
}//end else
}//end onLoad
}//end loadEntries
// Load Default
_parent.KlubbenText.loadEntries();
stop();
AddThis Social Bookmark Button