/    Sign up×
Community /Pin to ProfileBookmark

Combining a PHP file with Dreamweaver Flash file

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.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@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(){

sendData.name = _root.contactForm.name.text;
sendData.subject = _root.contactForm.subject.text;
sendData.email = _root.contactForm.email.text;
sendData.message = _root.contactForm.message.text;

sendData.sendAndLoad(path, recieveData, "POST");

}

//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.

If you need anymore help dont hesitate to ask.
×

Success!

Help @aimeec23 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...