Jump to content

Recommended Posts

Here's two options. You could do it a couple other ways too but I don't really know what you're doing since you didn't show code.

 

// Wait to Load Page
window.addEventListener("load", function()
{
   // Function
   function myFunc1()
   {
       alert("Function 1");
   }

   // Function
   function myFunc2()
   {
       alert("Function 2");
   }

   // Loop Numbers
   for (var i = 1; i < 3; i++)
   {
       // Evaluate / Execute String
       eval("myFunc" + i + "();");
   }
}, false);

 

// Wait to Load Page
window.addEventListener("load", function()
{
   // Function
   function myFunc1()
   {
       alert("Function 1");
   }

   // Function
   function myFunc2()
   {
       alert("Function 2");
   }

   var myFuncs = [ myFunc1, myFunc2 ];

   // Loop Functions
   for (var i in myFuncs)
   {
       // Execute Function
       myFuncs[i]();
   }
}, false);

  • 3 weeks later...

well I do as I've asked allot in actionscript I suppose I can just push each variables data into an array and then iteriate over the array. I just didn't want to make the extra step. If what I ask were possible then you would have answered diffrently since it would be very basic. I don't have any code to show I'm just asking basic questions. Thanks for your time. Javascript is very verbose anyway so I guess making some extra steps will be well worth the effort.

 

--calmchess

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.