hai friends,
i wrote a program to get mysql database values into FLASH thru php & i got it.
using those database values i wrote a program to display dynamic images in browser & i got it.
i wrote another another program to drag and drop images with their value and position & i got it.
and finally i wrote one more program to send back those dropped image values to php from flash & i got it.
the programs are…
to get mysql database values into FLASH thru php
var lvSend = new LoadVars();
var lvReceive = new LoadVars();
lvSend.SendAndLoad(“http://192.168.1.9/projects/khelorummy/user/getcardimages.php",lvReceive,"get”);
lvReceive.root = this;
lvReceive.onLoad = function(bSuccess) {
for (var i:Number=1; i <= this.n; i++) {
this.root.createEmptyMovieClip(“container”+i, i);
var mc = this.root[“container”+i];
trace(“http://192.168.1.9/projects/khelorummy/cards/"+this[“label”+i]+".gif”);
}
}
to display dynamic images and drag and drop images with their position and to send back to php
var lvReceive = new LoadVars();
lvReceive.onLoad = function() {
trace(this.phpVar);
}
var mcLoaderThree:MovieClipLoader = new MovieClipLoader();
mcLoaderThree.addListener(this);
for (var i = 1; i<=9; i++) {
var containerThree:MovieClip = createEmptyMovieClip(“containerThree”+i, i);
containerThree._name = “s”+i;
mcLoaderThree.loadClip(“http://sumanth/test/flash/cards/cardsgif/s"+i+".gif”, containerThree);
containerThree._x = 20*i;
containerThree._y = 10;
}
function onLoadInit(mc:MovieClip) {
mc.onPress = function() {
this.startDrag();
xstart = this._x;
ystart = this._y;
}
mc.onRelease = function() {
this.stopDrag();
var imgname = this._name;
xstart = this._x;
ystart = this._y;
lvReceive.imgname = imgname;
lvReceive.sendAndLoad(“http://sumanth/test/flash/ftop.php”, lvReceive,“post”);
}
}
getcardimages.php
<?php
$SqlQuery = “SELECT c
.label
FROM cards
c, cardsets
cs
WHERE c.cardID
= cs.cardID
”;
$Result = $DBConn->ExecuteQuery($SqlQuery);
if (!Result || mysql_num_rows($Result)==0) {
$rowset = '&msg='.mysql_error().'&';
} else {
$rowset = '&n='.mysql_num_rows ($Result);
$i = 1;
while ($row = mysql_fetch_assoc ($Result)) {
while (list ($key, $val) = each ($row)) {
$rowset .= '&' . $key . $i . '=' . stripslashes($val);
}
$i++;
}
}
echo $rowset;
?>
and finally ftop.php
<?php
$imgname = $_POST[‘imgname’];
echo “&phpVar=” . $imgname;
?>
now the problem is i wrote these programs individually when i combined these programs output is nothing. iam totally new to flash scripting. can anyone plz sort out the code to single program.
finally i want the output like
get mysql database values into flash thru php,using those database values display dynamic images in browser, drag and drop them with positions and send them back to php to store them in mysql.
mysql->php->flash->php->mysql
plz give me the reply its very very urgent. plzzzzzzzzzz
thanks for everyone in advance waiting 4 reply…