Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


assign a javascript call function to a submit button



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> Flash Forum
View previous topic :: View next topic  
Author Message
dazz_club
250+ Club


Joined: 15 Jul 2005
Posts: 313
Location: Chester and Hull

PostPosted: Sun Oct 16, 2005 5:36 pm    Post subject: assign a javascript call function to a submit button Reply with quote

Hi people, how would i assign a javascript function call to a submit button, ive looked in actions section and cant find it, any ideas to how this could be done?
Back to top
View user's profile Send private message Send e-mail
Samuel Rounce
100+ Club


Joined: 30 Oct 2005
Posts: 116
Location: London, UK

PostPosted: Mon Nov 28, 2005 6:32 pm    Post subject: Re: assign a javascript call function to a submit button Reply with quote

Apply this to the button:
Code:
submit = function() {
   fscommand(submitbut);
};

but_mc.onRelease(
   submit();
};


Insert this Javascript into the head of your HTML file:
Code:
<SCRIPT LANGUAGE=JavaScript>
<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function sampleFlaMovie_DoFSCommand(command, args)
{
  var sampleFlaMovieObj =
    InternetExplorer ? sampleFlaMovie : document.sampleFlaMovie;
  //
  if (command == "submitbut")
    document.formname.submit();
  //
}

// Hook for Internet Explorer
if (navigator.appName &&
  navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 &&
  navigator.userAgent.indexOf("Windows 3.1") == -1)
{
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write(
    'Sub sampleFlaMovie_FSCommand(ByVal command, ByVal args)\n');
  document.write(
    ' call sampleFlaMovie_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
}
//-->
</SCRIPT>


Good luck
Back to top
View user's profile Send private message AIM Address MSN Messenger
dazz_club
250+ Club


Joined: 15 Jul 2005
Posts: 313
Location: Chester and Hull

PostPosted: Wed Mar 08, 2006 5:06 pm    Post subject: java now working Reply with quote

Hi there,

Sorry for the late reply and i would like to say thanks, what you told me worked like a treat.

cheers.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> Flash Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap