For example, I've got a flash movie adding posts to the comments module. First I figured out what the url and query parameters were by looking at the php and HTML then just made a loadvars object that posted the required info.
Code: Select all
//Add comment to page (AS2)
//Adding comment object
var add_lv:LoadVars = new LoadVars();
//Check success object
var check_lv:LoadVars = new LoadVars();
//Send the post
add_lv.m6author = name.text;
add_lv.m6content = comment.text;
add_lv.m6submitcomment = "Submit"
add_lv.sendAndLoad("http://CMSMS/PATH/index.php?mact=Comments,m6,default,0&m6returnid=13&m6pageid=13", check_lv, "POST");
//Check the loadvars
check_lv.onLoad = function(success:Boolean) {
if (success) {
trace("loadvars success")
} else {
trace("Error loading/parsing LoadVars.");
}
};
I also put these in hidden divs so anyone on the HTML version of the site won't see them. It also needs some validation on the flash side to make sure all the fields are filled in.
Don't know if this is useful for what you're doing but it seems to work for me!