I recently developed a Dreamweaver command to automate a process I hate to do manually – turn French characters into their HTML entities. It’s pretty straight forward, highlight the copy you want to scan, select French Characters under the Commands menu and follow the prompts.
To install, unzip the files and drop them into your Commands folder.
I wrote it for CS5 but have since tested it in CS6 and it works.
So, I was one of the many who jumped on the bandwagon and bought a Playbook when they were offering them at a ridiculously reduced price over Christmas. I was never really that interested in getting one but they were cheap and I wanted an e-reader (Playbook comes pre-installed with a Kobo app) so I convinced myself that it was worth it. Continue reading “Blackberry Playbook OS 2.0”
I just heard that my former employer Les Stroud is going to be doing more episodes of Survivorman – but this time for 10 days instead of 7.
If you’re not familiar with Survivorman you should be. It basically invented the Survival TV genre – and no not the reality TV, I can win a car crap – the real stuff where people are actually required to know how to do it.
I loved the show and am definitely looking forward to the new episode(s) both as a fan and a friend of Les’ and I wish him and the Les Stroud Productions team the best.
I was writing a post about Events in AS3 and while explaining why in my opinion one approach to passing data is preferable to another I stumbled across the phrase “Set it and forget it” when it comes to programming. I think that this is a great way of describing how I like to write code and is a pretty good way of determining when a certain functionality should be abstracted into it’s own class or sub class.
The basic concept is that as a programmer I shouldn’t need to remember anything special about the class I have just written.
Obviously I’m not referring to things like a particular method or getters/setters but rather little gotchas that you won’t remember 6 months after writing the class.
For example, I was writing an ImageLoader utility class and added some functionality to create a thumbnail dynamically using the BitmapData class. I was pretty happy with the class and it worked very easily, once the data was available an Event was fired and a Getter method was called to return the bitmap. The only issue was that I was returning a Bitmap and MouseEvents are not triggered by Bitmaps so I was having to wrap the Bitmap in a Sprite and then assign listeners. As you can see, the extra step I have to remember is tedious and so I re-approached the class and wrapped the Bitmap in a Sprite before returning it. No fuss, no muss. Now I can just use the class without having to remember anything. I can “Set it and Forget it”
Garbage collection can be a big deal when writing complex programs in Actionscript. Not removing EventListeners is probably one of the biggest sources of AS holding onto memory it doesn’t need.
There is a very easy way to allow GC to handle your event listener clean-up for you when creating a new event listener – the useWeakReference argument.
Here is some standard code we’ve all done million times when creating a button:
var button:MovieClip = new MovieClip();
The two arguments are pretty straight forward the first is the event we’re listing for and the second is the function that is called once the event is fired, but there are actually 5 arguments that can be passed to addEventListener() here is the method definition:
<a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/IEventDispatcher.html#addEventListener%28%29">addEventListener</a>(type:<a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/String.html">String</a>, listener:<a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Function.html">Function</a>, useCapture:<a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Boolean.html">Boolean</a> = false, priority:<a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/int.html">int</a> = 0, useWeakReference:<a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Boolean.html">Boolean</a> = false):<a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/specialTypes.html#void">void</a>
the 5th argument (useWeakReference) is false by default but by setting to true, this eventListener will be automatically removed and freed for Garbage Collection when required.
Here is the new eventListener code updated to make use of useWeakReference.
I have been developing an AS3 library for the video publishing company Castfire on my own for the past little while and recently got in touch with them about continuing the endeavor. I thought it was a shot in the dark but they were more than willing to help out and so here is the first of, I hope, many articles on the Castfire API and the class library I am working with them to create for it.
The point of this library is to allow Flash devs like myself to easily access the Castfire API when creating custom video players.
Continue reading “Castfire AS3 Library”
I have been working on an update to my Easy Analytics plugin for WordPress and it’s almost ready. It’s a very big change in that I have added the ability to pull page stats and store them in a custom table in the WordPress database.
I have attempted to use the Google Analytics API before with limited success but this time around I used a very good PHP library called GAPI (Google Analytics PHP Interface). It is free to use and made the whole process of getting the data from GA very simple and is allowing me to focus on the plugin interface and programming options.
The catalyst for this addition to EA came from one of my clients. The project required a WordPress theme that pulled the most popular posts into a page. That in and of itself is not a big deal as there are plenty of plugins that will pull the most commented posts from the database but she wanted to use her Google Analytics stats as the basis.
I took a look around WordPress.org to see what options there were for plugins and I found that while many would connect to GA and pull the data in for use, the formatting options were limited to a sidebar widget or they would only output a list of links. I wanted more control over what each post looked like.
Currently I have the data being pulled in and displayed, There is a noticeable load time for the page so I am working on a way to cache the data in the database so the pull only happens once a day – which will reduce load times and since GA updates on a 24 hour delay anyway it’s extremely redundant to query the server every time a visitor hits the page.
I want to make the system as automated as possible so probably the first time someone hits either the Admin section or the page itself the pull will happen and the database will be updated. That way there is no need to manually hit a button to update the stats.
I will keep you posted on my progress!
So 2011 is now upon us. I am very excited for all the things that are coming my way. Watching my little girl’s first year of life would top that list of course. I want to wish you all the best in ’11 and hopefully one day, someone will actually read this blog o’ mine.
I am in the middle of working on a DVD for a client and there was a conversation about creating a Blu Ray disc as well.
So I did a little research and discovered that DVD Studio Pro does not author Blu Ray, only HD DVD. Well after a couple of clicks I found Adobe Encore and was simply amazed how easy it was to get building.
If you’re not familiar with it, Encore is Adobe’s DVD/Blu Ray authoring software and in my opinion is so easy to use you feel stupid for thinking that making a DVD was difficult at all.
I have some experience with creating DVD’s with custom menus in DVD Studio Pro and found the process to be not well documented.
The thing that I really love about the Adobe suites are how integrated the different programs are. In the case of Encore all the built in menu are built in Photoshop and there is even a button on the tool bar to edit the menu I Photoshop. That makes it so easy to edit a menu and learn the process on the go with the only prerequisites being knowledge of Photoshop and knowing the the naming conventions for creating buttons and replacement layers etc.
This next part is theoretical as I haven’t gone though this yet but it looks like I can create a Blu Ray disc and by simply changing a setting can use the same project to create a DVD. I would assume that the media would have to be transcoded to the correct size but Encore will take care of that for you. (please note that I haven’t taken into account the massive storage differences between the media so the content may have to change to accommodate)
The only hiccup in the process at this point is that I can’t burn Blu Ray discs on my Mac at home. I have been looking into the cost of a burner and they don’t seem that costly. If anyone has any experience with any particular models please let me know.
I’m working on a few personal projects to get more familiar with Encore and the overall process so I’ll let you know how it goes.
Say hello to our new addition!
Eve Susan Welcher
Born: October 31st at 11:22pm 5lbs 15 oz
Continue reading “Eve Susan Welcher”