Archive for the 'Web Development' Category

How to Manually Trigger Events in JavaScript

March 02nd, 2010 | Category: JavaScript, Web Development

Occasionally, I find need to be able to manually trigger a predefined JavaScript event from within the context of a web application. Those of you who didn’t understand that first statement may want to stop reading now or risk suffering from extreme boredom, but those who actually have encountered the same challenge in coding, please read on!

Let’s examine a possible scenario that could merit actually taking hold of the reigns on individual event calls. Consider the situation that you have devised a very user friendly data entry form, and in conjunction with specifications, you have a select box that triggers certain fields to be visible based on user selection. Typically, you would have simply attached a listener to the select box’s onchange event that checks the value of the field and performs the necessary showing and hiding. So far, we have done nothing difficult or out of the ordinary.

Now, suppose you also have need to be able to populate the form with a preexisting data set and get your form to behave in the same way. You could always write an onload listener for the body of your page that runs all the field checks and manipulates the fields accordingly, and in most cases, this may not be a poor solution. However, when loading dynamically via AJAX or other method, the onload event may not be triggered, and therefore, neither is your form updated.
Read more

No comments

jQuery Slideshow Plugin Update

February 26th, 2010 | Category: JavaScript, Programming, Web Development

I have finally found a few spare minutes to refactor the Google Code Project I started for my jQuery plugin last year. While I still am far from where I want to be with it, I have managed to set the plugin into a fully OOP codebase and add in events and the capability for custom handlers on those events. My hope is that people will now be able to find a bit more usability to the slideshow, since it is fully customizable. Feel free to swing by my Google Code page and let me know thoughts or ideas on ways to improve the slideshow as it evolves.

2 comments

Dynamic XML Slideshow in AS3

January 21st, 2010 | Category: Actionscript, Web Development

Over the past year or so, I have been responsible for developing and maintaining a JavaScript Slideshow component for our internal CMS. With the similarities between JavaScript and Actionscript, I have wanted to implement this slideshow in a manner consistent with the flexibility and usage of the JavaScript version. The biggest difference is that the JS one is focused on content, and the AS3 version will be focused on pictures – since AS3 does not fully support markup and CSS yet. This being said, I have had opportunity to attack my project and have the first phase completed. As with so many of my other personal projects, I’m tackling it in phases rather than having a defined spec list ready to go. In this case, I have the slideshow reading an image list from an XML document, loading the individual pictures and setting them on a timed rotation.
Read more

2 comments

JavaScript Library Nightly Builds, SymLinks and Auto-Updates

November 19th, 2009 | Category: JavaScript, Programming, Web Development

Something has been bothering me for some time, and I finally took the time to resolve the issue once and for all – relatively speaking. As mentioned in my previous post, I have had opportunity to work with multiple different JavaScript libraries, and I often find myself running behind on the newest bug fixes for a given module. Many of the library development teams offer a nightly build available to checkout via SVN or Git (usually by way of GitHub), and I devised a way to automatically update my shared repositories among all the domains on my server. While not rocket science, nor an entirely new idea to most of you, it is quite helpful to me, and I thought I’d share my method here.

There are actually four steps involved with this update, so I apologize in advance if this gets too long.

Read more

No comments

JavaScript libraries: jQuery vs. ExtJS

November 18th, 2009 | Category: JavaScript, Web Development

Often I have been asked which JavaScript library I prefer over all other, and the answer is not as easily orated as one might expect. Occasionally, I actually find someone willing to spend the time and thought involved with seeing the answer through to its conclusion. To avoid any undue future banter, I thought I would put my thoughts concerning the matter down in writing and simply reference this post when the topic is breached.

No, this will not be a comprehensive discussion and review of all available JavaScript libraries, but hopefully it will be sufficient to drive people to view the topic with a bit more of an open mind. Also, I must alert those who have come looking for a definitive answer from me: you will not receive a single library of choice here, but rather you will be given some insight to different perspectives requiring careful consideration when each library is being reviewed.
Read more

4 comments

Guam Reunion: West Coast Style

August 17th, 2009 | Category: Personal Life, Web Development

Interestingly enough, we have been contacted recently for a possible West Coast Guam Reunion sometime now that we are out here, and I have to say I’m rather excited about the possibilities. For one thing, it will require me brushing the dust off of the guamreunion.com domain and actually coming up with a theme and content that will be useful and usable. Part of that step, though, will be coming up with a basic WordPress theme that will be functional and easily maintained, and that is where I’m hoping my reader base will come in.

I have the know-how to create a WP theme, but in the realm of graphic design, a guru I am not. I’m hoping that some of you may have some experience and ideas on how best to capture a good design for this type of site and may be willing to pass your ideas along to me (preferably in the form of a PSD). So, Brade, Danny, Kammer (et all), I hope you are reading this!
Read more

No comments

Simple Actionscript Shooter Phase 1 (AS3)

May 08th, 2009 | Category: Actionscript, Game Development, Web Development

Well, OK, it’s not much of a Phase 1 – more like Phases 1, 2 and 3 all rolled into one simple demo, but for my purposes, the name will suffice. Many different ideas and techniques have been rolling around in my head for months, and I finally decided to try and find a simple way to implement some of those ideas into a working model; and what better way to do so than a classic shooter?

With flash gaming sites like Kongregate and ArmorGames offering incentives – and even revenue – to developers, I thought it about time to start put something together and just see what comes of it. Obviously, I have a long way to go, but here is a preview of a little application on which I am currently working.
Read more

1 comment

Embedding Fonts into Actionscript Only Project (AS3)

May 07th, 2009 | Category: Actionscript, Web Development

Embedding fonts has been a bane to me for some time, and I finally spent the time to find both the easiest and most comprehensive way to embed needed fonts into a SWF using AS3 only. As always, I try to keep the demos here as lightweight as possible, and I have tried to keep any code snippets I give free from external resources. In this case, there is a small exception, but it is only the exception of using one of the fonts installed on your own computer.

Basically, we need to understand a couple things about the nature of the embedded font in Actionscript. First, it must be assigned to a String in order to store all the character references. Next, you will quickly find that creating and implementing a TextFormat object to attach the font and styles to the different places in which it will be used is ideal. Finally, keep in mind that attaching several fonts to a single application can significantly increase the file size, so try to consolidate and style for variety as much as possible instead of selecting a boat load of different font faces.
Read more

1 comment

Map Handling Take 3 – Hover Over Borders (AS3)

May 06th, 2009 | Category: Actionscript, Web Development

Well, at the risk of sensory overload today – it’s my blog after all – I decided to post one more version of my map handler. This one adds in the classic mouse hover scroll effect at the edges of the map. I did try to make it a bit more usable, though, by calculating the distance from the edge of the map and accelerating the movement appropriately. So, the closer to the edge you are, the faster the map scrolls. So, to recap, you can use the following methods to move:
Read more

2 comments

Drag Viewport for Map Preview in AS3

May 06th, 2009 | Category: Actionscript, Web Development

So, a really quick update post here. Upon publishing my previous post, I received some great feedback from gamer friends who thought a good way to improve the interaction would be to allow for dragging the preview marker around to update the viewport in addition to simply clicking. After giving this some thought and suppressing some immediate concerns about the overhead calculations this might take, I have implemented this change and am interested in getting some feedback. Of course, all the other features (like clicking the preview and navigating the map using the A, S, D and W keys). Feedback welcome as always…
Read more

1 comment

Next Page »