Adobe flash maximum function length



  •  Yo!

     Does anybody know if Adobe Flash (or rather Macromedia Flash MX 2004) has a limit on the length of functions?

     I'm writing some garbage thing, and I've discovered that my (kinda long) function makes the built in debugging/playing environment (and any other Flash Player) completely crash when I add any more to it.



  • No idea if there's a function length limit, but here's a novel idea: break the function up into several smaller functions.



  •  @Matt.C said:

    Does anybody know if Adobe Flash (or rather Macromedia Flash MX 2004) has a limit on the length of functions?

    When you're programming something, typically if you have to ask "what's the limit" it means you're doing something wrong.

    Like bstorer said,  break it down into multiple smaller functions.



  •  No can do. Or rather, can do, but it would become very, very, very difficult to edit.

     Blast it all.



  • @Matt.C said:

     No can do. Or rather, can do, but it would become very, very, very difficult to edit.

     

    Not if you do it right.  It actually would become much, much eaiser to edit and probably much shorter, too.



  • @Matt.C said:

    No can do. Or rather, can do, but it would become very, very, very difficult to edit.
    plz send teh codez.



  • I can't send the code, but you can download the source code to my DS port of Lemmings; it's basically the same thing inside. (http://www.mrdictionary.net/lemmings/)

    Yes, the code is laid out the same too, which is to say 'badly'. But it (Lemmings) works. Except this doesn't, because of an undocumented facet (or at least, I can't find any guidelines on it) of Flash. It's a bit late to start fiddling with the code to try and make it nicer. I'll probably end up splitting my whocko game loop at arbitrary points and calling them 'function_the_first', 'function_the_second', etc, and obnoxiously take advantage of AS 2's lack of strict C-style scope.

     



  • Except! The game doesn't use pixel by pixel drawing like Lemmings: it uses movie clips. I'm not that crazy. (Yet.)



  • I'm Function the Eighth I am,

    Function the Eighth I am I am,

    I got called in the middle of a for(;;),

    Using proper scope is such a chore!

     

    And every line is pure hackery,

    Nary a forethought nor a plan (no plan!),

    GOTOs would result in less mockery,

    Maybe there's still room in the Swamp clan.



  • @bstorer said:

    No idea if there's a function length limit, but here's a novel idea: break the function up into several smaller functions.

    Funniest line of the week.

     

    To the OP, if you are developing within the flash IDE I would suggest stop torturing yourself and just use an external editor. I don't believe there is an actual function length limit, its probably just buggy.



  • @chebrock said:

    use an external editor.

    External .as files in somethin gother than a glorified <textarea> would do wonders, indeed.

    @Matt.C said:

    It's a bit late to start fiddling with the code
    to try and make it nicer. I'll probably end up splitting my whocko game
    loop at arbitrary points and calling them 'function_the_first',
    'function_the_second', etc, and obnoxiously take advantage of AS 2's
    lack of strict C-style scope.
     

    I think this means that now is exactly the right time to start fiddling.

    I'm assuming this is a home project 4fun.

     



  •  I tried external .as files. It appears that there's a limit to the maximum number of 'statements' that can appear in the Actions for any one function or frame, no matter how the code is placed there. I've come to the conclusion that it's exploding Flash's AS 'compiler' during the publishing stage. (Which is why the resulting SWFs act as if there's no Actions at all in affected frames)

     I would probably find a lot of use for an external editor (with function/braces folding!), but switching back and forth between the editor and Flash would get old mighty fast.



  • @Matt.C said:

     I tried external .as files. It appears that there's a limit to the maximum number of 'statements' that can appear in the Actions for any one function or frame, no matter how the code is placed there. I've come to the conclusion that it's exploding Flash's AS 'compiler' during the publishing stage. (Which is why the resulting SWFs act as if there's no Actions at all in affected frames)

     

    So where's the WTF here, AS compiler imposing a statement limit that's too low, or the programmer trying to jam too much stuff into a single function?



  • @HypocriteWorld said:

    So where's the WTF here, AS compiler imposing a statement limit that's too low, or the programmer trying to jam too much stuff into a single function?

    This is a 3 month old thread.  Please do not resurrect old threads.  Thank you. 



  • @morbiuswilters said:

    Please do not resurrect old threads
     

    For the love of god who made up this insufferable rule? Does it really matter? Can't something new be said about a topic, even if it's a month or two after the fact?

     



  •  Also for some reason this thread was displayed at the top of the list, so I assumed it's new.



  • @HypocriteWorld said:

     Also for some reason this thread was displayed at the top of the list, so I assumed it's new.

    You need to click on "Edit Profile" in the top right corner, click the "Site Options" tab, and uncheck the box that says "Sort posts randomly to enrage morbiuswilters."



  • @bstorer said:

    @HypocriteWorld said:

     Also for some reason this thread was displayed at the top of the list, so I assumed it's new.

    You need to click on "Edit Profile" in the top right corner, click the "Site Options" tab, and uncheck the box that says "Sort posts randomly to enrage morbiuswilters."

    I'm still not sure why that feature is on by default... 


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.