Updated Loops

Finished working on my new article for <a href=”http://www.communitymx.com”>Community MX</a>. I had modified some loops for use in the article, so figured I’d update the one I have currently here as well as add the new one. They’re off to the left under Downloads on the “Custom Classes” header.

Process uses a custom class thrown on _global that uses setInterval to emulate for loops so you can write more efficient Flash apps. The Safe Process is a component that does much the same thing, except it uses onEnterFrame to give you almost 100% protection from that bloody “Script is running too slow” error.

Both have examples in the comments of their respective files. Process.as can work via <code>#include “Process.as”</code> on the main timeline while SafeProcess.as needs to be put into a movie clip with a linkageID of “SafeProcessSymbol”.

<a href=”http://psychlonex.dyndns.org/”>John Robinson</a> made a good point last night while talking over email during my breaks from writing. He said that it seems most Flash developers prefer using #include in their code to dropping custom component classes in their library (usually ActionScript that does stuff with little or no visual content). I almost never use #includes. Is this true for you?

7 Replies to “Updated Loops”

  1. Same here. I write all the code in DWMX and that brings up a good point for the wishlist. If I have FMX and DWMX open, I should be able to make a change to the code in DWMX (.as file which will be included in FMX) and without switching applications, compile the swf from within DWMX. Switching between FMX, DWMX and IE has become such a custom that I don’t even think about it anymore, but this would be a nice feature. What do you think?

  2. I use the #include, mainly because of FMX panels are screwd. (I hope in Flash 7 its fixed). (Ie you preview mode, and come back and wtf did my panel go!)

    That and I think it steems from CFMX/DHTML coding, some how I like the color coding better.

    It also helps to keep your source code in one area for recyling.

  3. I use Flash MX to code in, yes. At work, I use Dreamweaver MX because we have all of code externalized into .as files so it will work in version control in Visual Source Safe. I’d prefer to use Flash MX, though.

    Additionally, I agree that that Dreamweaver MX should be able to compile Flash MX via a code change. Scite Flash can do this easily, so why can’t Dreamweaver?

    I’ve gotten used to my satanic panels. No, I don’t think it’s acceptable, but I like one editing environment and would prefer to stick to Flash. I like all my code and stuff all in one spot. This will probably be the second time people are shocked; I seem to be the only developer doing this. Certainly changes my mind on the best way to distribute components, for sure.

  4. I seem to be unable to decide. I like the Flash IDE because of all the code hinting, which is unavailable in BBEdit. But I still use .as for most things because the Flash IDE is slow. I keep the main component code in Flash, and use .as for any external libraries … Basically any class that is not the component’s class.

  5. I use the Dreamweaver Flash combination. Type a change in DW. Then to compile, I have this lightning twitch ‘ctrl-s’ – ‘alt-tab’ – ‘shift-enter’ thing. It’s almost like I’m working in the same program.

  6. For speed and prototype development I code in the environment. For production I use include because it allows me to use version control with source safe.

Comments are closed.