PDA

View Full Version : Flash AND php variables on the one page



Carixpig
February 17th, 2005, 04:36 PM
Hi All,

I've designed a timesheet system using php and mysql. The part where you enter times is currently a dropdown thing, but feedback says users want an easier way to enter times, so now I have a timeline swf that you click and drag over the time you want to enter, much like the timeline in Flash.

I have no trouble sending the data from Flash to php or sending the html form data to the php action page. But I can't seem to do BOTH.

The submit button on the form will send the form data only - no Flash data. Having a submit button in the swf sends the Flash data but not the form data.

I can't do it all in the html form for obvious reasons (there would be no interactive timeline) and I can't do it all in flash because there are some dropdown / list-menus that load data from a mysql table. I also need the date to be pre-selected in dropdown / list-menus.

The form stuff is easy - how do I get both the form AND Flash to send to the same action page simultaneously?

Cheers,
C

rafusmx
March 9th, 2005, 03:07 AM
mmm... How do you get both to send the same action page simultaneously? That's a pretty good question... but I had a few ideas that you could try.

- You could try to make a full flash page, including both your form and the interactive time line in the same flash movie.
- On the other side, you could try a JavaScript (I don't know how to do it but I know JavaScript can help you managing the form) that should process your mixed page, but as far as I know you should be making the call from the flash form.

If any body have an answer to his problem, I'll be glad to read it too... I'm intrigued

CyanBlue
March 9th, 2005, 07:59 AM
Howdy... :)

I think I've seen this question some time ago, but I cannot tell where it was... :D

Okay... This is how I'd tackle the problem...

I assume that there is HTML form on top of the Flash timeline, and when you press on the submit button in Flash, you want to pass the HTML form data on top of the Flash variables, right???

I think you will need to use JavaScript to broadcast the data from the HTML form to Flash movie whenever the form entry is changed... I think you will need to use setVariables() function in JavaScript to talk to Flash and Flash will be using watch() function to listen to the change...

So, once the submit button is pressed, you can collect all the HTML form data, which should be available by that time if the user has changed the HTML form entry, plus the Flash data and send it to the PHP script...

Just my 2 cents, of course... :)

Carixpig
March 10th, 2005, 01:16 AM
Thanks y'all, I might try it sometime and let you know how it goes. For the moment I'm settling for more conventional means, i.e. dropdowns to select start and finish times.