Skip to main content
Known Participant
January 5, 2007
Question

collecting and submitting info when click buttons

  • January 5, 2007
  • 14 replies
  • 677 views
OK, what I have is a flash module where people go through and click options to have something customized and built visually in front of them. I have that part going fine and it works/looks great.

Now, what I need to have going on in the background is that every time they select an option, it stores the code for that option in some sort of hidden text field. There will be four choices they go through, so it should be selecting the options, comma deliminated, and holding them there as the user goes through.

At the end, when they click submit, I need to have it take all that info and send it on with a javascript function. I need to know how to have it collect and hold the info along the way, then at the end send that JavaScript function with it in there (I have the function ready)

The JavaScript function will be like this, where "a" "b" "c" etc is the data we've collected on the way throughout the module:
JavaScript:SubmitCustom(a, b, c, d);


How do I get it to do that??? Your help will be GREATLY appreciated!
This topic has been closed for replies.

14 replies

Known Participant
February 8, 2007
Hmmm... when you click submit it doesn't seem to try (not even an error message)... any ideas?
Known Participant
February 8, 2007
OK, the cart side is finally ready for me to implement the flash side...

when I'm setting up the buttons as they go through the custom builder module, would the actionscrip0t look like this for each button?


on (release) {
a="Standard";
//Movieclip GotoAndPlay Behavior
this.gotoAndPlay("21");
//End Behavior

}

It's going to another frame because they have to move onto their next selection... the a="Standard"; is one of the selections for their custom item.

kglad - I'll upload the fla and pm you where it's at, and also a url where you can see the test page and a test link that's set up to go to the cart.
kglad
Community Expert
Community Expert
January 8, 2007
you're welcome.
Known Participant
January 8, 2007
It seems that the guy doing the cart portion didn't have it ready for me to connect to anyway, so that may have been part of the problem. Now the site's down, to... I'll be in touch if I have any trouble once everything's back up and ready for me to link to with my module. Thanks again!!!
kglad
Community Expert
Community Expert
January 8, 2007
go ahead and post a link to your fla
Known Participant
January 8, 2007
It still isn't working... I'll pm you the url where I'm testing it on the site and if you would be willing I can give you my flash file to look t? I need to get it working and it's just not getting there... I'm sure you could have it figured out in a snap.
Known Participant
January 7, 2007
OK, so I set all that up and submitting didn't seem to call the JS correctly. I tried rephrasing the ActionScript like this:

on (release) {
import flash.external.*;
ExternalInterface.call("javascript:SubmitCustomBoot(a, b, c, d);");
}

Must not have done it right? I feel like I'm almost there... what did I do wrong? Basically the link should be javascript:SubmitCustomBoot(a, b, c, d); where a, b, c and d are whatever value choices they had selected, which I put in there as you had instructed above.

Thanks again for your help... any idea what I should change for th esubmit though?
kglad
Community Expert
Community Expert
January 8, 2007
you didn't do it correctly. use the code i gave in my above message:

kglad
Community Expert
Community Expert
January 6, 2007
yes, put the ExternaInterface.call() method in your submit button.
Known Participant
January 6, 2007
Awesome... I'll try that!

Right now the onRelease function is that the image of whatever custom feature they're adding to their item animates and adds itself to the item in front of them. I'll add this to the onRelease actionscript.

So hopefully it'll store this information as the user goes through the various options in the module? Then submit all of it at once in my JavaScript action? I'll try!!! :)
Known Participant
January 6, 2007
Basically the user is clicking on buttons that are images of the options they're selecting to add to their customizeable item (and then it visually adds the customized options - it's really cool), so I was thinking I'd have a hidden text field somewhere that will be collecting the appropriate info for their selections and then when they're done and they click "buy" it will send the javascript function through to the cart.

I am open to whatever is the best way to do this. Right now I have the whole thing working visually and it's awesome, the client loves it... I just have to make the part where the order is submitted via that javascript work now.

Thank you a thousand times over if you can help me!!! :)
kglad
Community Expert
Community Expert
January 6, 2007
the buttons they click must have an onRelease or onPress handler. in that handler for one of your buttons use