A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Organizing Your ActionScript

  1. #1
    Member
    Join Date
    Feb 2004
    Location
    United States
    Posts
    34

    Organizing Your ActionScript

    I have been working on very large fla file that has become quite complex. I have many movie clips that contain several other movie clips and instances nested inside, which also have many more movie clips and instances nested inside them(but it actually goes much deeper). Most of these movie clips have very large timelines with lots of ActionScript. In short, the file has become very difficult to manage and it isn't even finished. So, would it be considered bad practice to place all of my ActionScript on the main timeline in frame 1 of an actions layer and just call the pathnames of movie clips and instances throughout the file?

  2. #2
    Senior Member wessamzeidan's Avatar
    Join Date
    Sep 2003
    Location
    Lebanon
    Posts
    160
    For me, this is the way I do it, and I guess this is the best way, since you can manage all your scripts in one place.....
    Proudly a Palestinian

  3. #3
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    2,920
    It is definitely not a bad practice to place all your scripts in either frame 1 or a frame following the preloader.

    That's how I always do it. Otherwise, you're asking for grief.

    No less an authority than Colin Moock also recommends this method.

  4. #4
    Member
    Join Date
    Feb 2004
    Location
    United States
    Posts
    34
    Perfect. Thats exactly what I needed to hear. My life is much easier now... Thanks guys

  5. #5
    Senior Member
    Join Date
    May 2002
    Location
    Salt Lake City
    Posts
    211
    If you start writing using OOP, it can cut down on the amount of code in everything. It's amazing how much you can do with MovieClip.prototype.nameYourFunction = function(variable1,variable2){
    } and then combining this with some onEnterFrame functions. Just make sure you delete your oef's.

  6. #6
    Member
    Join Date
    Feb 2004
    Location
    United States
    Posts
    34
    I've dabbled in OOP with ActionScript, but I'm just getting to where I have a grip on AS 2.0. I have a book relating to OOP with ActionScript but, I don't really have time to read 500 pages at the moment, so if you know of a good tutorial explaining some of the more useful tricks--that'd be great.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center