I’m not a huge fan of flash components. I’ve run into too many instances of incompatibilities between version and components themselves. However the ScrollPane component is just too useful to pass up. The thought of having to build my own basic UI components also seems like a waste of time.
This article is being written because the documentation on this component is not spectacular and can be quite ambiguous to the new actionscript programmer. I ran into trouble in the methodology of how ScrollPane wants you to work.
Normally the addChild method is used to embed one MovieClip in another. That was the method I assumed would work for the scrollpane. However after getting the error “Error #2006: The supplied index is out of bounds.” I realized that was not how it worked.
To simplify, use:
scrollPaneInstance.source = movieClipContainer;
NOT:
scrollPaneInstance.addChild(movieClipContainer);
Due to the fact I’m not a huge fan of the components that come with Flash I’m wondering if anyone has found any other ScrollPane type components that are lightweight and open source. TweenLite is an example of a lightweight alternative to the built in flash library for tweening.
Jeremy
Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s. When he’s not banging code into his keyboard at work, Jeremy is banging out beats for his band “Sad Skelton” that you can check out at www.sadskelton.com.
Recently we had a project where the design required growing vines, a popular analogy for growth. I had used masks before to create the grow effect but was never really happy with the results or the lack of flexibility with that method. I searched the internet and found a number of different ways to do it but still it didn’t have the look I wanted so I modified one of those techniques to get what I needed.
I’m using After Effects CS3 in this tutorial.
The most versatile solution I found comes from the stroke effect. The stroke effect mimics a brush stroke following along a mask path. You can animate the start and end points as well as the thickness. This would have worked fine, but I didn’t like how the stroke maintained the same thickness along the length of the path. I wanted the think point at the top of the vine, getting thicker as it grew upwards. Read the rest of this entry »
Jeremy
Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s. When he’s not banging code into his keyboard at work, Jeremy is banging out beats for his band “Sad Skelton” that you can check out at www.sadskelton.com.
It has taken some time to find the Drupal modules that really work well for us. Drupal.org can be a little hard to navigate for newcomers, making it hard to decipher what’s really important. It would be great if Drupal would publish a most downloaded module list.
In that light, we thought we would post a list of the 10 Drupal modules we use on pretty much every project. These work best for our web clients and we think they are essential to any Drupal install. (NOTE: this refers to Drupal 6.x modules)
- Pathauto - Having custom URLs is essential to ease of use from the clients point of view. Even if it is arguable whether more descriptive URLs help with search engine ranking, the usability benefit of having custom URLs trumps all.
- WYSIWYG API – As coders, we would be more comfortable entering content with clean code. But for most clients this is unrealistic. TinyMCE has become the WYSIWYG editor of choice for us. Using the WYSIWYG API we can set up unique profiles for different user groups and have as much (or as little) functionality available as the job requires. The WYSIWYG API also supports a host of other editors including FCKEditor, jWYSIWYG, markItUp, NicEdit and Whizzywig.
- Scheduler - Scheduler is most useful on blogs or news oriented sites where users may be preparing stories weeks in advance. This adds a couple of fields to a node that specify the start and end dates. This module is dependent on the Drupal cron module running regularly so take that into account.
- IMCE - An image browser. This module allows the user to navigate through files on the server in specific directories configured by the administrator. This module is essential for use with WYSIWYG in order to add images easily to any content area. NOTE: for proper integration with TinyMCE you will need to use the IMCE Wysiwyg API Bridge.
- SMTP Authentication Support – This may not be required on every setup, but in our hosting environment the default PHP mail function is disabled. That means we need to use SMTP to send mail. The core Drupal install doesn’t support SMTP for sending mail, but with this module you will be able to enter a server address as well as authentication details if required.
- Administration Menu – This is a great one for Drupal newbies. When logged in as an administrator you will get a thin black menu at the top of your site. This allows you to navigate to any area of the site. This comes in especially handy in the early stages of developing a template when the menu system may not be built yet. NOTE: Take into account that the admin menu shifts your whole design down a couple pixels. We have found this can interfere with background images that are lined up with content. Add a slightly modified style on body.admin-menu to compensate.
- XML Sitemap – Provides a complete sitemap in the standardized XML format specific for consumption by search engines. Currently it can automatically send (with cron) to Google, Yahoo, Microsoft Live and Ask.com.
- Webform - This allows us to create forms with custom fields. We frequently find that clients want “just one more field” than the default Drupal contact form provides. This module is essential any time you are looking for feedback from the user. Form submission can be emailed to multiple addresses as well as stored in the database. You can even download an Excel document with the data.
- SpamSpan - This module provides email obfuscation. It is important to prevent email harvesting bots from grabbing emails from content on the site. We try to use contact forms for most emailing, but it is inevitable that a client will enter an email somewhere on the site.
- Views - It looks like at least a basic version of this module is going to be included in Drupal 7 core. Views allows you to display any collection of nodes in a variety of ways. It also provides a deep level of templating to customize specifically how different aspects of the view shows up.
Jeremy
Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s. When he’s not banging code into his keyboard at work, Jeremy is banging out beats for his band “Sad Skelton” that you can check out at www.sadskelton.com.

Came across an interesting article that talks about a new element that was introduced in recent browser releases. The canvas tag. In this article they are suggesting that the options provided with the canvas tag are the same as those which Flash offers.
The largest hurdle canvas has in replacing flash is performance. A flash SWF file is compiled. That means it’s a binary file that only the Flash player (and compatible players) can understand. Canvas on the other hand is controlled exclusively by Javascript, a scripted runtime language. That means that the code is interpreted and run at the time the page is viewed.
Take a look at this article which starts the discussion: Is Canvas the End of Flash?
However, although canvas may not replace flash, it does have many niche uses. One problem it is looking to solve is that of font limitations. Take a look at typeface.js, a library that replaces text with fonts other than the few web safe fonts we’ve used for years.
Jeremy
Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s. When he’s not banging code into his keyboard at work, Jeremy is banging out beats for his band “Sad Skelton” that you can check out at www.sadskelton.com.
With Flash animation & video clips becoming a staple of modern web designs there are frequent instances where an HTML element will overlap your flash clip. This could be a lightbox, drop down menu or modal popup window. There is a fairly simple fix for this. Set the WMODE attribute to true.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="900" height="1000" title="test">
<param name="movie" value="rtraction_animation.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="rtraction_animation.swf" wmode="transparent" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="900" height="1000"></embed>
Notice how wmode is an extra param tag for the object tag and just an attribute for the embed tag.
That’s great if you’re coding the HTML directly but due to the IE Flash ActiveX bug many people began using Javascript libraries to embed flash. The syntax is quite simple for the 2 most popular Javascript Flash libraries AC_FL_RunContent and the open source SWFObject 2.0.
AC_FL_RunContent
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','900','height','1000','title','test','src','rtraction_animation','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','rtraction_animation','wmode','transparent' );
AC_FL_RunContent is Adobe’s Javascript library for dynamically embedding Flash. You’ll notice each this function equires the name of the option with the value right after. We just added wmode and transparent as parameters at the end of the function.
SWFObject
swfobject.embedSWF("rtraction_animation.swf", "rtraction_animation", "300", "120", "9.0.0","expressInstall.swf", '', {wmode:"transparent"}, {id:"rtraction_animation",name:"rtraction_animation"});
This version is our preferred which uses the open source SWFObject 2.0 library. Add the option parameter wmode and set it to transparent. The Javascript library generates the proper tags on the fly.
Jeremy
Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s. When he’s not banging code into his keyboard at work, Jeremy is banging out beats for his band “Sad Skelton” that you can check out at www.sadskelton.com.
Menus can be range from simple text to complicated visual effects. When it comes to the most used and popular menus one of the most common things we do on our sites is add a separator character.
For example:
Home | Products | Contact Us | About Us
CSS seems like it should be the simplest solution. Add a border-left: 1px solid #000. However the first element of this menu should not have this border. CSS 2.1 has given us the first-child and last-child selectors. This would be the perfect solution other than the fact that Internet Explorer 6 does not support these selectors (CSS and browser content and compatibility). IE7 is incrementally better supporting just the first-child selector.
Until we finally can let go of IE6 support (perhaps when IE8 comes out?), we will need to find another solution. The easiest is to add the class “first” to the first element of the menu and “last” to the last element of the menu. This will allow us to target styles specifically for those menu items.
Now that we develop a number of our sites in Drupal, we have had to come up with a solution for it. If developing in Drupal 6 then the work is already done for you. Drupal 6 now includes first and last classes on all menus. Drupal 5 only includes the first and last classes on primary and secondary links and not for menus displayed in blocks.
Using theme overides you can customize your site to add first and last classes. Take a look at the following article on Have “first” and “last” classes on menu blocks.
Jeremy
Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s. When he’s not banging code into his keyboard at work, Jeremy is banging out beats for his band “Sad Skelton” that you can check out at www.sadskelton.com.
We recently ran into a situation where we needed multiple tables to appear as a single table. To make sure each column lined up, we needed to set the width of each cell to a set pixel amount.
The first attempt added a width to the <td> as follows:
<td style="width: 150px">some content goes here</td>
However, by nature, table cells will always resize to accommodate the content that is placed in them. That is what they were designed to do. The cell will maintain its 150 pixel width as long as the content is smaller than the specified width.
The solution is to add a div inside each cell. It adds some extra markup, but will ensure that the cell will not resize beyond the specified width. Divs can be set to specific dimensions, and will stay as such even if the content will not fit inside.
So our table cell code now becomes:
<td><div style="width: 150px">some content goes here</div></td>
Jeremy
Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s. When he’s not banging code into his keyboard at work, Jeremy is banging out beats for his band “Sad Skelton” that you can check out at www.sadskelton.com.
Every now and then, you run into a situation where you have a large amount of code executing to create a complex page. This can lead to response times for web page requests that are not adequate for your client. Everyone should know by now that some basic coding standards and some simple caching can go a long way to prevent slow page load times. Sometimes, however, those simple steps are just not enough. Be sure that pages only load the code they require to display information. Also, be sure that you have set up some caching on your website (this also helps with heavy traffic loads). Another thing to remember: to find out where any bottlenecks might be hiding, it is important to run some benchmarks on your code. Sometimes a simple database call that might be executed multiple times on a page can be running very inefficiently and drastically affecting all of your load times.
One tool that can be useful is XDebug (which we previously talked about here). One thing not covered in our previous blog article is the ability to perform benchmark analysis on data captured with XDebug. Using a tool called WinCacheGrind, you can analyze the cachegrind profile file output by XDebug. This will allow you to target and eliminate or reduce functions that negatively impact your website’s performance. If you are hosting your site with Apache, another notable option is to set up Alternative PHP Cache (APC). You will need to verify all your website’s functionality is working properly with APC enabled. Our experience is that APC provides a great reduction in load times when configured properly.
Last but not least, be sure to think about performance when writing your code. There is a great article with 40 optimization tips over at reinholdweber.com. Click here to check out the optimization tips and feel free to comment with any other performance tools or tips you or your company have found useful.
Jeremy
Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s. When he’s not banging code into his keyboard at work, Jeremy is banging out beats for his band “Sad Skelton” that you can check out at www.sadskelton.com.
There have been numerous occasions where we have retrieved the result of an array and yet still needed to do some kind of sorting. Up until now it seemed like there was no answer. The answer was found with the function array_multisort. The names of some PHP functions can be quite misleading but this one does what it says.
The trick to using this function is that it sorts based on columns. The normal layout of a database table returned into an array is with each row of the table is a seperate element of an array. The 2nd dimension of the array has the table row names as the keys with the value attached.

So there is our table represented in an array with each element as a separate row. To sort we need an array for each column, in this case fruit and color. We use the following code to accomplish this.
foreach ($query_result as $key => $row) {
 $fruit[$key] = $row['fruit'];
 $color[$key] = $row['color'];
}
It seems quite unintuitive but essentially each column is a separate array with the row number being the key. Now we are able to plug this new data into the array_multisort function to sort our existing array (NOTE: the new column based arrays we created are specifically for the purpose of sorting)
array_multisort($color, SORT_DESC, $fruit, SORT_ASC, $query_result);
Basically you list the order of columns you want to search by. In this case we’re sorting by color descending first and then by fruit ascending. The last parameter is the multi-dimensional array that you want to sort.
Seems like a convoluted way of a simple sort. It’s always best to do all sorting and querying in the database but for the few situations that just isn’t possible, we have a solution using array_multisort in PHP.
Jeremy
Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s. When he’s not banging code into his keyboard at work, Jeremy is banging out beats for his band “Sad Skelton” that you can check out at www.sadskelton.com.
LightWindow is an advanced “lightbox” JavaScript component that can be used for a wide range of media. We were simply trying to use it as an image gallery. What we ran into is that every once in a while when clicking on a link to trigger the slideshow, LightWindow would fail to size the image properly in IE6. This only seemed to happen in IE6 though reading through others experiences it seems like it may happen in IE7 as well although we never came across any problems with IE7.
When you run into a problem with someone elses tool it can be very difficult to solve the problem. After an exhaustive search we were able to find the solution posted on a german blog at www.trilodge.de. Although we don’t speak german it was obvious this was the solution to our problem.
Although this solution is already available from www.trilodge.de we know this will help any other developers who run into this issue as its hard to find the german solution being the blog is in another language.
The problem happens in the image loader. It seems to think the image has loaded when it has not. Therefore it is unable to get an accurate size.
To fix replace:
// We have to do this instead of .onload
this.checkImage[i] = new PeriodicalExecuter(function(i) {
if (!(typeof $('lightwindow_image_'+i).naturalWidth != "undefined" && $('lightwindow_image_'+i).naturalWidth == 0)) {
this.checkImage[i].stop();
var imageHeight = $('lightwindow_image_'+i).getHeight();
if (imageHeight > this.resizeTo.height) {
this.resizeTo.height = imageHeight;
}
this.resizeTo.width += $('lightwindow_image_'+i).getWidth();
this.imageCount--;
$('lightwindow_image_'+i).setStyle({
height: '100%', width: '100%'
});
if (this.imageCount == 0) {
this._processWindow();
}
}
}.bind(this, i), 1);
With this:
// We have to do this instead of .onload
var ie = (document.all)?1:0;
this.checkImage[i] = new PeriodicalExecuter(function(i) {
if(ie){ //THE BROWSER IS IE
if ( $('lightwindow_image_'+i).complete && !(typeof $('lightwindow_image_'+i).naturalWidth != "undefined" && $('lightwindow_image_'+i).naturalWidth == 0)) {
this.checkImage[i].stop();
var imageHeight = $('lightwindow_image_'+i).getHeight();
if (imageHeight > this.resizeTo.height) {
this.resizeTo.height = imageHeight;
}
this.resizeTo.width += $('lightwindow_image_'+i).getWidth();
this.imageCount--;
$('lightwindow_image_'+i).setStyle({
height: '100%', width: '100%'
});
if (this.imageCount == 0) {
this._processWindow();
}
//alert('IE has been detected')
}
}
else
{//NOT IE, PROBABLY FF, OPERA, OTHER
//this line works for all other browsers
if ($('lightwindow_image_'+i).complete && !(typeof $('lightwindow_image_'+i).naturalWidth != "undefined" && $('lightwindow_image_'+i).naturalWidth == 0)) {
this.checkImage[i].stop();
var imageHeight = $('lightwindow_image_'+i).getHeight();
if (imageHeight > this.resizeTo.height) {
this.resizeTo.height = imageHeight;
}
this.resizeTo.width += $('lightwindow_image_'+i).getWidth();
this.imageCount--;
$('lightwindow_image_'+i).setStyle({
height: '100%', width: '100%'
});
if (this.imageCount == 0) {
this._processWindow();
}
}
}
}.bind(this, i), 1);
If you have any other suggestions or ran into any other problems feel free to post them below and we would be happy to update the post to help others.
Jeremy
Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s. When he’s not banging code into his keyboard at work, Jeremy is banging out beats for his band “Sad Skelton” that you can check out at www.sadskelton.com.