|
-
How can I submit HTML form with flash button?
Hi,
I'm striking out figuring this out on my own, I have an HTML form but I want to use a flash button to submit it. (the button needs to show a 'hit's state, it's for a kiosk).
I assume it's some simple actionscript but I can't figure out how to do it. An explanation or an example would be greatly appreciated. I am using Flash 8.
Thanks
Tom
-
Since Flash can invoke javascript.You can add actionscript to your button to invoke the javascript function to submit your form
<script language="javascript">
var myForm=getElementById("youformID");
myForm.submit() ;
</script>
Sorry friend I've never tried this before but I know the way to do.You can find tut about Flash and javascript in the tutorial section
-
Junior Member
To call Khoma's method from flash, it needs light rewriting:
Code:
var fSubmit=function(){
var myForm=getElementById("youformID");
myForm.submit() ;
}
in flash:
code:
on(release) {
getURL("javascript:fSubmit();");
}
Hariyemadzisawira nhaka yedu! Down the SCUD and win!
I'm too lazy to read Private Messages.
-
Ok, seems I'm putting the actionscript in the wrong place. I just put it in a layer on its own in the scene. I got this error:
**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 1: Mouse events are permitted only for button instances
on(release) {
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Clip events are permitted only for movie clip instances
onClipEvent (mouseUp) {
Total ActionScript Errors: 2 Reported Errors: 2
My button is a symbol - where do I actually put this script so it will work?
Thanks for the help.
Tom
-
You have to put it on the button symbol it self. Th code On Release means that when you release the button, it does blah,blah,blah.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|