Log In    |    Knowledge Base    |    4D Home
Tech Tip: Macromedia Flash & 4D
Published On: January 11, 2002
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Macromedia Flash is an increasingly popular choice for developing web pagesMany developers ask: "Is it possible to have Flash communicate with 4D?" The answer is a resounding "Yes!"...and then some more good news: "It's actually very easy!"

Here is the Action Script for a button in Flash that sends some data to 4D:

on (release) {
loadVariables ("", _root, "POST");

"loadVariables" is a Flash function that will call the specified URL. When you are editing the "loadVariables" function in the Object Action palette, you will see there is an option for variables: "Send using POST" and "Send using GET". This will send the Flash variables to 4D, which you can access using GET WEB FORM VARIABLES as if the data had come from an HTML page.

To send data back to Flash, you issue a simple call like this:

SEND HTML TEXT("success=1&message="THIS CAME FROM 4D")

where "success" and "message" are variables in Flash. The "loadVariables" call will parse the result into the Flash variables.