When creating a PHP file in Dreamweaver for a Flash wesbite- how do you combine the two files once you’ve finally imported your Flash website file into Dreamweaver? Created the PHP file for a contact form in my Flash website.
@martswiteMar 31.2009 — #Hey the flash loadvars function will do this really nicely for you.
for example set actionscript like this.
[code=php] //Path to PHP script on the server from the page the swf is embedded in. var path:String = "php/script/handler.php";
//Create a loadvars object that will send the data to the php script var sendData:LoadVars = new LoadVars(); var recieveData:LoadVars = new LoadVars();
//When the form submit button is pressed send the data submit_btn.onPress = function(){
//When php recieves information back from the recieveData loadVar this will happen recieveData.onLoad = function (){ _root.output.text = recieveData.message; } [/code]
Now for the php
[code=php] //Just to see if the vars are passed to the php file check to make sure on of the variables holds some data and if it does send it back to flash for confirmation. if(isset($_POST['name'])){ echo "&message=the name was recieved and it is ".$_POST['name']; }
[/code]
Obviously without knowing exactly what you need this isnt ideal but it should give you a basis to start from.