Page 2 of 2

Re: Adapt CMSMS for Flash front-end - Help needed!

Posted: Mon Jul 21, 2008 9:15 am
by tomgsd
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.

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.");
	}
};
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!

Re: Adapt CMSMS for Flash front-end - Help needed!

Posted: Mon Jul 21, 2008 9:36 am
by madsny
yes im having a somewhat problem accessing the modules from flash, mainly because i don't understand the way they are build and are very likely not to :D hehe.
i basically just want to be able to modify data in the sql server, so i can add values to the page field like, position and other crazy things one would want to need, it's no problem to create a costume PHP script for this task, which i'll be doing, but this is not a very safe way, if any got the notice of then name of the PHP file they could basically do alot of mess on my website :D.

i believe it'll take some time before we see a flash hookup for all the modules, thou i strongly believe that CMS made simple should build it, it'll be one of the vildest CMS out there since you can basically hook your dataflow up to any front end even unity3D if you like :D.
but for now, i'll just make a hack, costume php script with a password handshake from flash, guess that's the best for now :D.

:)