June 23rd, 2007
I just installed MAMP on my Macbook. This is great, as it gives me MySQL, Apache, and PHP all ready to go. First, I restored default ports in preferences, and then I discovered the beauty of TextMate shortcuts when I typed in vhost[tab] in my httpd.conf file while adding in some of my dev sites. Beautiful. I was ready to go. Now, I just needed to load up some databases. Off to the command line… But, there was no mysqladmin. On top of that, the default php 4 install was in my way when I went to do pear upgrades.
The binaries I wanted were there. They just weren’t in my bash path. Once I found the directories I needed, I just added them to my path by appending the following lines to my ~/.profile…
# Add MAMP binaries to front of path
PATH=/Applications/MAMP/bin/php5/bin:\
/Applications/MAMP/Library/bin:$PATH
export PATH
You’ll notice the existing PATH is appended to the end so that my MAMP php binary is now found before the old php4 version when I type ‘php’ from the command line. I also have access to mysqladmin, mysql, etc. like I would on just about every other machine as well as apachectl so I can do things like config tests and vhosts dumps (apachectl -S).
In my opinion, this should really be a part of the MAMP install. Anyway, I thought I’d document it here for future reference.
Posted in Mac, PHP | 7 Comments »
June 13th, 2007
GridLayout (com.bumpslide.util.GridLayout) is a class I originally created to simply manage the attachment and positioning of a series of MovieClips. I began using it to build all my data grids, thumbnail lists, and various types of menus. Recently, I have refactored it to support scrolling and/or paging via an index offset as well as paged data loading via the AS2 DataProvider API. The end result is an all purpose utility that can be used to build everything from simple menus to custom data grids. This post is just a quick introduction to using the code. Parts 2, 3, and 4 (to come) will go into more details about scrolling and data loading as well as alternative uses of the GridLayout class.
You can get a sneak peak at the examples here.
Read the rest of this entry »
Posted in Actionscript, Flash | 4 Comments »
June 4th, 2007
The site JD and I made for Burst Labs made Site of the Day for May 27th, 2007 on FWA. If you haven’t seen it, you should check it out.
http://burstlabs.com/
Everything you see was built from scratch. The back-end is a custom MySQL database and admin tool I built using CakePHP. Middleware is AMFPHP, and the front-end is all Flash 8 Actionscript 2.0. When I have more time, I will try to blog a bit about some of the components I built.
Nerd Highlights:
- Custom data grid built with com.bumpslide.util.GridLayout supports mousewheel and paged data-loading
- State management with com.bumpslide.data.Model
- SWFAddress for deep-linking and Back-button support tied directly to the Model
JD has more on the subject.
Posted in Actionscript, Flash, News, PHP | Comments Off
June 4th, 2007
Demo: Easy Interpolation
Source: Interpolation.as
Commenting on my Interpolating Sine post, Saravanan wrote:
is there a way to smooth this line..........please help........
Why, yes, there is. Again, Patrick has done all the dirty work, but unfortunately his interpolation code was dependent on his demo movie clip classes. Rather that bother a man who is now retired, I borrowed his code, removed the dependencies, made it MTASC friendly, and am sharing it with you now. Patrick's cubic bezier and interpolation classes have been combined into com.bumpslide.util.CubicBezier.
Here is a quick sample of using this class to draw a smooth curve through a series of random points:
Actionscript:
-
import com.bumpslide.util.CubicBezier;
-
-
// create some random points
-
var targetPoints:Array = new Array();
-
for(var i=0; i<9; i++) {
-
targetPoints.push({x:50+50*i, y:Math.random() * 300 + 50});
-
}
-
-
// interpolate the points
-
var overshootFactor = 20;
-
interpolatedPoints = CubicBezier.interpolatePiecewise( targetPoints, overshootFactor );
-
-
// draw
-
var holder:MovieClip = createEmptyMovieClip('holder_mc', 1 );
-
holder.lineStyle(0, 0x880000);
-
holder.moveTo(interpolatedPoints[0].x, interpolatedPoints[0].y);
-
CubicBezier.drawBeziers(holder, interpolatedPoints);
The full example and all related source files are all in my Bumpslide Library SVN repository.
References:
http://www.5etdemi.com/blog/archives/2006/10/interpolating-points-using-piecewise-cubic-beziers-source-code/
http://www.timotheegroleau.com/Flash/articles/cubic_bezier_in_flash.htm
http://www.moshplant.com/direct-or/bezier/
Posted in Actionscript, Flash | 1 Comment »
April 16th, 2007
Just sharing a useful little JSFL script I made. This script started as a tool to output class vars for items on the timeline. It now actually creates an entire class that can be used as a starting point when coding up view components. Comments above each class var come from the timeline layer names, and the script even looks up assigned class names and adds appropriate import statements. It's useful for simple code generation, but can also help you quickly spot clips without instance names and things of that sort. Output goes to the trace panel where you can copy and paste just the pieces you want.
To install, just download and install the MXP file, or grab the plain JSFL file and drop it in your flash commands folder. The javadoc template and everything is just inline with the JSFL. So, open it in your favorite javascript editor, and hack away to personalize it if desired. And, despite what Extension manager tells you, no flash restart is required.
Flash Extension: timeline_to_class.mxp
Source JSFL: [tkd] timeline_to_class.jsfl
Posted in News | 1 Comment »