oceansky
10-05-2001, 01:57 PM
Sorry for answering this question again. However, have been searching on the boards, reading all the tutor, sorry for my stupid, I still cannot figure out how to export the data from php to flash.
I am building a simple scrolling box on _level2, with variable "scrolltext".
Here is my as script in flash and my php script, any mistake? If it was too long to read, please read the following ##### part only, Thank You!
##########################
as: loadVariables("http://www.birdview.com.hk/phpmyagenda/flash.php3", "_level2.ScrollBox");
php: print "&scrolltext=$allflash";
##########################
onClipEvent (load) {
// Setting the variables for the Scrolling script
loadVariables("http://www.birdview.com.hk/phpmyagenda/flash.php3", "_level2.ScrollBox");
scrolling = 0;
frameCounter = 1;
speedFactor = 1;
}
onClipEvent (enterFrame) {
if (frameCounter % speedFactor == 0) {
if (scrolling == "up") {
scrolltext.scroll -= 1;
} else if (scrolling == "down") {
scrolltext.scroll += 1;
}
frameCounter = 0;
}
frameCounter += 1;
}
<?php
$agendauser = 1;
include ("application.php3");
if(!isset($rootagenda))
$rootagenda="";
$language = "chinese";
setcookie("language" , $language);
include($rootagenda."lang/$language.lang.php3");
include ($rootagenda."admin/include/place.inc.php3");
$req_listevents = "SELECT e.id , e.title, e.description, e.contact1, e.contact2, e.contact3, e.contact4, e.contact5 , t.type , d.start
FROM events e, eventtype t , date d
WHERE t.id = e.type
AND d.event = e.id
AND d.start >= NOW()
ORDER BY d.start ASC
LIMIT 0 , 5";
debug("listing request = $req_listevents");
$qid = db_query($req_listevents);
// mode soon
// input value to temp
$flash = array("", "", "", "", "");
$n = 1;
$temptype = "";
$temptitle = "";
$tempdescription = "";
$tempdates = "";
$tempplace = "";
while ($r = db_fetch_object($qid)) {
$temptype = $r->type;
$temptitle = $r->title;
$tempdescription = $r->description;
$qidate = db_query("SELECT start, end, place.name FROM date,place WHERE date.place = place.id AND date.event = '$r->id' ORDER BY date.start");
while($dates = db_fetch_object($qidate))
{
$tempdates = dispdate($dates->start , $dates->end , $language);
$tempplace = $dates->name;
}
db_free_result($qidate);
$flash[$n] = "<font size=16 color=#33FFFF>"."$temptype"."ĄG "."$temptitle"."<br>"."<font size=12 color=#CCCCFF>"."$tempdescription"."</font>"."<br>"."<font size=10>"."$tempdates"."<br>"."$tempplace"."</font>"."</font>"."<br><br>";
$n = $n + 1;
} db_free_result($qid);
// input value to temp
// transfer the string value to flash
$allflash = "$flash[1]$flash[2]$flash[3]$flash[4]$flash[5]";
print "&scrolltext=$allflash";
?>
I am building a simple scrolling box on _level2, with variable "scrolltext".
Here is my as script in flash and my php script, any mistake? If it was too long to read, please read the following ##### part only, Thank You!
##########################
as: loadVariables("http://www.birdview.com.hk/phpmyagenda/flash.php3", "_level2.ScrollBox");
php: print "&scrolltext=$allflash";
##########################
onClipEvent (load) {
// Setting the variables for the Scrolling script
loadVariables("http://www.birdview.com.hk/phpmyagenda/flash.php3", "_level2.ScrollBox");
scrolling = 0;
frameCounter = 1;
speedFactor = 1;
}
onClipEvent (enterFrame) {
if (frameCounter % speedFactor == 0) {
if (scrolling == "up") {
scrolltext.scroll -= 1;
} else if (scrolling == "down") {
scrolltext.scroll += 1;
}
frameCounter = 0;
}
frameCounter += 1;
}
<?php
$agendauser = 1;
include ("application.php3");
if(!isset($rootagenda))
$rootagenda="";
$language = "chinese";
setcookie("language" , $language);
include($rootagenda."lang/$language.lang.php3");
include ($rootagenda."admin/include/place.inc.php3");
$req_listevents = "SELECT e.id , e.title, e.description, e.contact1, e.contact2, e.contact3, e.contact4, e.contact5 , t.type , d.start
FROM events e, eventtype t , date d
WHERE t.id = e.type
AND d.event = e.id
AND d.start >= NOW()
ORDER BY d.start ASC
LIMIT 0 , 5";
debug("listing request = $req_listevents");
$qid = db_query($req_listevents);
// mode soon
// input value to temp
$flash = array("", "", "", "", "");
$n = 1;
$temptype = "";
$temptitle = "";
$tempdescription = "";
$tempdates = "";
$tempplace = "";
while ($r = db_fetch_object($qid)) {
$temptype = $r->type;
$temptitle = $r->title;
$tempdescription = $r->description;
$qidate = db_query("SELECT start, end, place.name FROM date,place WHERE date.place = place.id AND date.event = '$r->id' ORDER BY date.start");
while($dates = db_fetch_object($qidate))
{
$tempdates = dispdate($dates->start , $dates->end , $language);
$tempplace = $dates->name;
}
db_free_result($qidate);
$flash[$n] = "<font size=16 color=#33FFFF>"."$temptype"."ĄG "."$temptitle"."<br>"."<font size=12 color=#CCCCFF>"."$tempdescription"."</font>"."<br>"."<font size=10>"."$tempdates"."<br>"."$tempplace"."</font>"."</font>"."<br><br>";
$n = $n + 1;
} db_free_result($qid);
// input value to temp
// transfer the string value to flash
$allflash = "$flash[1]$flash[2]$flash[3]$flash[4]$flash[5]";
print "&scrolltext=$allflash";
?>