Archive

One of my best clients, an agency in Houston, has an opening for an AS3 developer. If you are available and in the Houston area (locals strongly preferred), then send me an email at theAlgorithmist[at]gmail[dot]com. You should have the following background.

A firm foundation in OOP and event-driven programming with demonstrable expertise developing highly interactive applications in AS3. You should know something about basic design patterns. Flash 10 experience is a bonus. Mobile is an even bigger bonus, but not a requirement. You need to have experience in creating reusable components and helping designers with modest scripting skills create visual elements to be integrated into a larger application. You also need to know how and when to hack something quick to make a deliverable on a short time frame.

Flex/FlashBuilder IDE experience is valuable, but not required (i.e. creating Actionscript projects and integrating visual content created by designers using Flash CS4/CS5). Flex framework experience is a bonus but not required.

Any experience you have using third-party AS3 libraries and extending them to create new functionality is highly desirable. You will be required to work with such libraries developed by me 🙂

Don’t send me a resume. Resumes are B.S. documents created for HR people and managers that want buzzwords and other B.S. Show me an online blog/portfolio or something that demonstrates your skills. Then, we’ll talk. I will forward promising candidates onto my client.

I’ve worked with this company for over six years and can vouch that although an agency environment can be challenging, these people are absolutely great to work with. Looking forward to hearing from you.

Shane McCartney has created a high-level presentation (about 136 slides total) on efficient programming practices. Experienced Flash developers may already know most or all of these, but you never know when a good tip might pop up in one of these slides, so check it out and see what you think.

Just some quick props to Ryan Christensen for a good post, including a robust set of links, on the topic of AS3 optimization and improvements in the F10 player. Can’t have too much information on this topic 🙂

Visited InsideRIA this afternoon and noticed the interesting optimization article. We’ve seen lots of information on AS 3 optimization. What makes this article different is the inclusion of Flex practices for good app. performance.

If you update your code base from SVN, there should now be a com.degrafa.utilities.math folder with some new goodies. These are low-level math utilities that will be used in upcoming advanced versions of the quad/cubic Bezier classes and Bezier utilities such as closest point to a quad/cubic Bezier.

Current methods include

Bisect – classic bisection algorithm for locating a root within an interval

Gauss – Numerical integeration using Gauss-Legendre

Newton – Simple implementation of Newton’s method

Halley – Simple implementation of Halley’s method

SimpleRoot – AS3 port of Jack Crenshaw’s TWBRF

Solve2x2 – Solve 2×2 systems of equations using Cramer’s method, with support for caching determinant.

A simple test program (MXML file) illustrating the usage of these methods can be downloaded here. These are very low-level utilities that will be used in future Degrafa development and may be of value to advanced users.

Continuing the code deconstruction from this post, the second pass of the algorithm is split into two parts. The first distributes text up to the final knot in the spline. The second part handles the case where the text extends beyond the natural spline boundaries. This is done by using the curve’s orientation toward the end of the spline to extend the text in a straight line in that direction, as shown in this post.

The variable, s, denotes arc length along the spline. The variables, endX and endY record the coordinates of the spline at s=1 (or the endpoints). The Boolean variable, cacheRotation istrue if we are using a constant (precomputed) rotation value, which is the case when the text extends beyond the end of the spline. The rotation variable denotes the rotation of the TextField for each letter distributed along the spline.

estimates the tangent to the curve at the current s parameter. The cumulative text width is multiplied by the inverse of arc-length to estimate the s-parameter corresponding to the beginning of each letter, as previously described. We could use the Singularity method that returns the derivative of the spline at the parameter value (which is the slope of the tangent), however, I wanted this code block to be usable with other packages that draw Bezier curves. Most of those packages do not return derivative information, so it is estimated by dy/dx ~ Δy/Δx for small Δx.

The tangent of the spline at s is used to orient the TextField to align with the tangent at that point. This is just a starting-point for aligning the text and works reasonably well except in places where the spline has extremely high curvature. Understanding this first approximation is helpful before delving into more complex algorithms.

A unit vector in the direction of the tangent approximation is computed next and the TextField’s rotation property is set,

Note the use of the atan2() function. The x- and y-components of the unit vector are used to compute the normal vector, which is needed to position the TextField. This will be discussed in the next part of the deconstruction.

In many practical circumstances, the amount of text to be distributed along a curved path exceeds the length of the path. It is possible to extrapolate parametric curves beyond the normal [0,1] domain, however, arc-length parameterization applies only to the restricted domain. Arc-length parameterization is necessary to uniformly distribute text along the curve.

One reasonable compromise is to use the tangent approximation at the end of the curve to extrapolate along a straight line. This approach is also computationally efficient as a single unit vector and normal can be reused for each letter distributed along the line.

This approach is illustrated below.

I still have one small glitch to work out with this approach and then I will put the text-along-spline code on the back burner. The next big priority is to help the Degrafa team start to move Singularity code into the Degrafa code base. The first step in this process will be to rewrite the cubic Bezier spline to be independent of the current Composite class. Although I can’t predict every possible porting issue, at a high level it should be largely a matter of replacing the FastBezier class with the Degrafa cubic Bezier class.