Skip to content

Fix MacBook Pro Optical Drive Problems

Yesterday I was greatly distraught when my MacBook Pro’s superdrive would not accept blank DVD-Rs. When I inserted a blank DVD-R it spun around for a bit, sped up, slowed down, stopped, then spit it back out at me with no error message. It read DVDs, burned CDs, and read CDs fine; but I could not get it to accept a blank DVD-R! I searched around and found information about the MacBook superdrive update which killed alot of people’s optical drives. I couldn’t remember if i installed the update or not, so I was fairly worried because I did not want to drop $400 to fix something which an Apple update broke. I tried a bunch of tricks to try to get my beloved superdrive to work, but to no avail…

Continue Reading

TextMate: Local CSS Validation

Although TextMate comes with a built in CSS validation command it would sometimes fail for me depending on where I was working from (some locations have proxy software on the main router). I rewrote the command in the style of the PHP-HTML validator I posted earlier. You can add more validation options using -F. I’ve only used this script on CSS only files, it might not work on inline CSS in HTML documents. [code lang=”bash”]#!/usr/bin/env ruby -wKU scope = STDIN.read scope.gsub!(/< /?style.*?>/, ”) open(‘|curl -sF file=@-;type=text/css -F lang=en http://jigsaw.w3.org/css-validator/validator’, ‘r+’) do |io| io < < scope io.close_write while io.gets $_.gsub!(//, '&') print $_ end end [/code]

Continue Reading

TextMate: W3C HTML Validation For Local PHP Files

It is impossible to validate local PHP files via the built in W3C validation that the TextMate HTML bundle provides because it does not parse the PHP code in the PHP document. I’ve modified the default validation script to retrieve the file using OS X’s built in apache server (the script assumes you have your files in the ~/Sites directory) so it will work for not only PHP, but any apache-interpreted language. I’ve added the ss option to the W3C validator, you can add/remove any validation options to the curl command as you see fit…

Continue Reading

Macromedia Components & Object.prototype Don’t Get Along

In most of my flash projects I have a prototype file I include into the project. It contains additions to core objects such as Object, MovieClip, etc. Well, today I found out that some Macromedia components (ComboBox was the one I was having trouble with) don’t like additional methods to be defined on certain classes (Object was the one I found that ComboBox was having issues with); they fail to continue to work with additional methods defined. However, there is a workaround: ASSetPropFlags. Simply hide all additional methods with this line of code: [code lang=”actionscript”]ASSetPropFlags(Object.prototype, null, 1);[/code] I can’t wait until AS3 can be used all the time.

Continue Reading

Flash: Create MovieClip With Custom Class

I’ve always wanted to attach a movieclip to the stage with a class other than MovieClip without having to use swfmill or the ide to create a movieclip with linkageID + custom class. Well that day is finally here! I found a nice snippet of code on the net and modified it a bit to act more like attachMovie (ability to specify an initOb). The result? createClassMovieClip:s [code lang=”actionscript”] /* Description: A function used for creating empty movie clips with subclass association. Parameters: c:Function – The class to associate with the the empty movie clip. name:String – The instance name for the empty movie clip. depth:Number – The depth for the empty movie clip…

Continue Reading

Flash & Fonts

I’ve written about the pains of fonts in flash before; and it something that still plauges my work today. However, since that post new tools have been created, new workflows introduced, and with that some new findings. Fonts With SWFMILL SWFMILL is an awesome tool that may allow you to leave the Flash IDE untouched for some projects. However, embedding fonts seems to be scarcely documented (I had trouble getting the methods documented working). Here are the two links I’ve found that document embedding fonts with swmill: Adding fonts to your SWF with FAMES Using SWFMILL I wasn’t able to get embedded fonts working using the information above, so here is my method. This is what my swfmill xml looks like…

Continue Reading

AttachMovie & Loaded Clips

Using attachMovie when you’ve loaded other clips into your movie has always been very painful. You can’t attachMovie a asset into a loaded clip that is located in the parent movieclip, and conversly you can’t attachMovie a asset in a parent that was loaded into a child. This is extremely frusterating… but after some searching today I came across this interesting link. Using the fact that Flash likes to cache everything it can, he created a function that will load an clip that contains an asset into the movieclip you are trying to use attachMovie from. Nice idea, never thought of doing this before…

Continue Reading

Jump To A HTML Anchor in a WebView

This isn’t something that is as straightfoward as you would think. There is no real ‘cocoa native’ way to acomplish this, and there seemed to be no information anywhere on how to acomplish this until I found this post. So it seems the only way to scroll to an anchor is to resort to evaluating javascript code: [code lang=”javascript”] – (void) jumpToAnchor:(NSString *)anchor { [oWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@”var anchor = document.anchors[“%@”];window.scrollTo(anchor.offsetLeft, anchor.offsetTop);”, anchor]]; } [/code]

Continue Reading

Don’t Forget To Flush…

No, not the toilet, your file streams. I was recently working on a project that involved creating a child process and reading its stdout to update the user inteface. Everything was working great until I sent it off to some testers who reporting that it ‘wasn’t working’ – the interface wasn’t updating correctly. I first thought it was a problem with the shell command itself, maybe it wasn’t performing the operation correctly and thus wasn’t sending the correct message through stdout but as far as I could tell everything was working perfectly. After about 3 hours of banging my head against the wall trying random things I finally thought to flush the stdout after sending my status message. It fixed it!..

Continue Reading

XASH 1.4

Following the XTrace 1.1 update is XASH 1.4. This is a smaller release, but still comes with a good number of improvements: Search speed improvements Hitting return with the help tree in focus will open the currently selected page in the help tree Hitting return in the search field will cause the top most search item to open The book filter is now ‘sticky’ (remembers which book you last filtered by) Compiled & tested as a universal binary Actionscript 3 Support Alot of people have emailed me asking about support for Actionscript 3. The fact is, I dont use Actionscript 3 yet (don’t do nearly as much Flash work as I did), so I have no desire to add support for Actionscript 3 documentation…

Continue Reading