[development] an interface for legacy Flash forms

Ronan Berder berder at teddy.fr
Sat Aug 21 05:15:57 UTC 2010

I would advise you to use the Services (http://drupal.org/project/services)
module when handling Flash integration in Drupal; when using the Drupal Form
API you get a lot of safety mechanisms that are involved that ensured you
can submit the data you submitted, as well as that data is properly
formatted. Now you're trying to use a Flash form; having a user service that
is running in the background to handle your updates using JSON for example
may be a better way to do it. You have a lot of tutorials about
Flash/Services integration laying around.

On Sat, Aug 21, 2010 at 9:33 AM, Rob Koberg <rob at koberg.com> wrote:

> Hi,
> Unless I am doing something incorrect (spent the day on it), I can't
> get legacy Flash (swf) http form posts to be handled with Drupal. For
> example, we have a custom swf avatar builder. The swf, onsubmit, does
> a POST with a single parameter. (I don't have the source, but could
> legally decompile it and add extra fields(?) for the form identifiers,
> if that could help. I know less Flash than PHP)
> I was thinking the easiest way to go would be to make a simple interface:
> $DRUPAL/avatar.php
> <?php
> if (!empty($_POST)) {
>        require_once './includes/bootstrap.inc';
>        drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
>        $account = $GLOBALS['user'];
>        dd('save $account: ' . $account);
>        $avatar_xml = $_POST['avatarXML'];// it is url encoded
>        dd('save $avatar_xml: ' . $avatar_xml);
> } else {
>        header('HTTP/1.1 405 Method Not Allowed');
> }
> I get the log entries written and the parameter value, but I don't get
> a page user object.
> What I want to do in this case is save a single profile field value,
> 'profile_avatar_xml' which is added at registration time with default
> data. How can I get to the 'global $user;' (which I tried) object so I
> can set: $user->profile_avatar_xml = $_POST['avatarXML'];
> thanks,
> -Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100821/363ff5fb/attachment.html 

More information about the development mailing list