About the Labs Wiki
The Labs Wiki was originally meant to showcase all of our projects and anything else we found interesting. But I think we’ve had greater success with this as a blog format. With this said, and to reduce redundancy, I’m going to start clearing out the wiki and moving any unique content here to the blog. This was a long time coming, since the blog I haven’t really updated anything on the wiki anyways. So this just makes sense.
So expect to see some more details popping up on the projects pages and maybe a few more posts. Enjoy!
Notes: General AS3 Tips
This is the final bit migrated from the Labs Wiki. This is just a short list of quick and easy tips to keep in mind when programming AS3.
- Do not use Objects, if you know which properties will be finally involved. Write a class for it; AS3 seems to register a memory space for them and will have faster access.
- Keep variable names as short as possible. While this doesn’t help a lot, it does help a little.
- Items of 0 alpha are still draw on the stage. Use visible = false to save CPU cycles
Notes: Math Optimizations
This is some more stuff migrated from the Labs Wiki. Below is just some aggregated tips and tricks I’ve found on other blogs or websites.
Extract Colors
Not really an optimization per se, but just how to extract color values.
//24bit var color:uint = 0x336699; var r:uint = color >> 16; var g:uint = color >> 8 & 0xFF; var b:uint = color & 0xFF; //32bit var color:uint = 0xff336699; var a:uint = color >>> 24; var r:uint = color >>> 16 & 0xFF; var g:uint = color >>> 8 & 0xFF; var b:uint = color & 0xFF;
Compile Timestamp – Timestamp your SWFs!
- Compatibility: ActionSctip 2.0 / ActionScript 3.0
- File Size: About -Kb
- Change Log
Description
Compile Timstamp is a Flash extension that adds a new layer to your fla with a trace of the filename and compile timestamp. Used with FlashBug, this allows you to easily check the version of your online swf. This was created because the servers we used at work often cached our files on multiple servers. So it was difficult to tell which version we were actually looking at.
Sample
Try Compile Timestamp (You will need to FlashBug open to see the trace)
#### index.fla - 01/17/2008 11:46:39am
Features
- Seamlessly adds a timestamp to your SWF when published
- Contains the time, date, and name of the FLA
Notes: Flash 9 Gotchas/Bugs
This is also migrated over from labs. This was a list of bugs and gotchas I’ve run into over during my time as a Flash developer. I’m sure the best play to look would be Adobe’s Bug tracker but it doesn’t hurt to have a concise list of things to watch out for.
Bugs/ Gotches
-
Bug
wmode="opaque"or"transparent"disablesKeyDownactions (not true in 9,0,60,0 beta) and disablesMouseWheelactions
Black Box – Flash Secure Login
- Compatibility: ActionScript 3.0
- File Size: About -Kb
- Change Log
Description
BlackBox is a Flash-based login application. We built this much for the same reasons Comet was. We didn’t have anyway of doing a secure (read SSL) connection so we made our own next best thing. Whats funny is that in the end, the method we “ingeniously” came up with is almost the exact same method used with POP servers to send email.
This is an older project pulled from Labs and is currently password protected. This might change later, it might not. I wouldn’t hold your breath on this. This was made becuase a friend of ours worked at a company that didn’t allow any IM programs and we were too cheap to setup a server.
Features
- Secure login – Session based
- Easy to setup