Hey Florian,
i'm trying to get reviews that are written in an input text box thats in the Settings MC into my localhost database just to test, i don't think the problem is in my PHP but here it is...
<?php
if (isset($_POST['newReview'])){
include_once("Connections/connection.php");
$userReview = $_POST['newReview'];
$sql = mysql_query("SELECT * FROM reviews WHERE review='$userReview'"); $userReview = $row["review"];
}
if ($_POST['newReview']) {
$state = $_POST['newReview'];
$sql = mysql_query("INSERT INTO reviews VALUES review='$userReview'"); }
?>
And heres the ActionScript, the only things i've added are var variables, varSend, varLoader just after the imports and the onClose function down at the very bottom where i put
variables.newReview = reviewTxt.text;
varLoader.load(varSend);
into the function. If you could help it would be great. I'm pretty poor at AS so if you could explain in simple terms i would be really grateful.
package de.mightypirates.megazine.gui {
import de.mightypirates.megazine.MegaZine;
import de.mightypirates.utils.Localizer;
import de.mightypirates.utils.Logger;
import de.mightypirates.utils.ToolTip;
import flash.display.*;
import flash.events.*;
var varSend
:URLRequest =
new URLRequest("http://localhost/megazine_experiment/megazine/review_parse.php");
varSend.data = variables;
varLoader.
addEventListener(Event.
COMPLETE, onClose
);
public class SettingsDialog extends
Sprite {
public function SettingsDialog(mz:MegaZine, loc:Localizer, lib:Library) {
visible = false;
loc.registerObject(tt, "text", "LNG_SETTINGS_ACCEPT");
(gui
["dragBar"] as Sprite).
buttonMode =
true;
(gui
["dragBar"] as Sprite).
addEventListener(MouseEvent.
MOUSE_DOWN, onStartDrag
);
addChild(gui);
addEventListener(Event.
ADDED_TO_STAGE, registerEventListeners
);
}
private function registerEventListeners
(e
:Event):void { removeEventListener(Event.
ADDED_TO_STAGE, registerEventListeners
);
addEventListener(Event.
REMOVED_FROM_STAGE, removeEventListeners
);
stage.
addEventListener(MouseEvent.
MOUSE_UP, onStopDrag
);
}
private function removeEventListeners
(e
:Event):void { removeEventListener(Event.
REMOVED_FROM_STAGE, removeEventListeners
);
stage.
removeEventListener(MouseEvent.
MOUSE_UP, onStopDrag
);
}
startDrag(false);
}
stopDrag();
}
variables.newReview = reviewTxt.text;
varLoader.load(varSend);
visible = false;
dispatchEvent(new Event("closed"));
}
}
}
Thanks a million
Florian: just added code highlighting to make it more readable.