Re: Adapt CMSMS for Flash front-end - Help needed!
Posted: Mon Jul 21, 2008 9:15 am
Not really sure exactly what you are wanting to do but I've had some success communicating with modules from flash via the loadvars class.
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.
Back in the php code you can send back success or fail messages in the form: &success=false&error=noauthor& OR &success=true&
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!
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!