— tomauger.com

Archive
Technology

Couldn’t find anything really definitive on this, so here it is. Object.hasOwnProperty() is defined by EMACS and is supposed to be present on any (and all) objects in JavaScript.

So this would (normally) make a good way to make sure that a DOM element has a certain method before calling it (particularly to be safe if the DOM object for some reason doesn’t exist as expected)

For example:

elem = document.getElementById("someDOMElement");
if (elem.hasOwnProperty("innerHTML")){
  // ... do something cool with the innerHTML of this element
}

Unfortunately, this technique fails out of hand in IE because, although native Objects do support this method, for some reason DOM objects do NOT. So it will always fail, and more likely give you the dreaded “object does not support this property or method”, which is precisely the reason you wanted to use this method in the first place!

IE can go to hell. What’s wrong with these people?

Read More

Apparently, the Western Digital MyBook line of external USB/Firewire hard drives have their share of problems. Fortunately, I haven’t had (knock on linoleum) the sorts of hardware failures that many have reported.

However, when using the MyBook via 4-pin firewire attached to my smoking Dell XPS Notebook, I have intermittently experienced complete lockups as the Plug and Play driver kicks in and craps out. It hasn’t helped installing the WD Drivers that are highly suspect, so in fact I uninstalled everything on my computer that smacked of “Western” or “Digital” (well, sort of) using Add/Remove Programs.

One trick that appears to be working is quite simple: don’t plug the power into the hard drive until AFTER you have plugged the firewire cable into the computer. Could be blatant superstition, but so far, so good. Okay, to be honest, I’ve only tried it the one time but that time it worked!!

Anyway, just a tip. Try it out if you’re experiencing troubles. Let me know how it turns out. Then buy Seagate.

Read More

So, with great trepidation I unleashed just a tiny little portion of CS4 on my primary production workstation a few weeks ago: Flash CS4 and Dreamweaver CS4. I foolishly decided to work on what was supposed to be a dead-simple mini project (with a mini deadline) using Flash CS4. Sort of a “trial by fire”. Well, I got burnt. Badly.

Turned-on by the new Timeline / Motion Tweening model (they finally listened and brought back the AfterEffects-style animation model from LiveMotion – remember LiveMotion?) I jumped into a very simple project: I was going to do a little “slideshow” of images that would simply fade in, grow a little on the screen and then fade out. Sounds dead simple, right? And in CS3 it would have been a snap. Turns out that it IS a snap in CS4, it just took me over two weeks to figure it out, with Jen DeHaan of Adobe’s patient help. Sounds like the cats on the Adobe Flash team made some pretty funky decisions regarding the new timeline. Let me walk you through what I’ve learned.

Or you can just follow the threads on the Adobe Forums here and here.

In a nutshell the problem is this: by default, the behaviour of the new motion tween in Flash CS4 is that it takes over the entire layer that it is on. As much as the Adobe guys claim that this is “object-level” motion tween, it still completely consumes the layer it’s on in the timeline. What’s worse, by default, it’s actually very hard to mix two different movieClip or Graphic symbol animations on the same layer of the timeline. What occurs is that if you have one symbol with a Motion Tween attached to it in a layer, and then on some later frame in that same layer you try to add a Motion Tween to a different symbol, that symbol gets hijacked and actually physically becomes the earlier symbol. That’s right. You drag a symbol onto a layer that already has a Motion Tweened symbol on it, and as soon as you add Motion Tween to the new symbol – BAM! it becomes the other symbol. In fact, even if you look at that symbol in the Library, it’s been changed!

Don’t believe me? Read on…

Read More

 I don’t like wasting people’s time (what few readers I may have) with rants and raves, but I got hit in the gut twice recently by unfortunate updates.

Being the progressive guy that I am, I upgraded my Adobe Acrobat Reader software (upon ceaseless prompting by Adobe Updater) to Acrobat Reader 9. I also installed Adobe Acrobat (the full version) 8 within a short timeframe. At some point in that flurry of acrobatic upgrades, I lost my ability to display PDFs in my browser window. Explorer, Firefox, Safari, Opera – nada, zilch, bubkus, zeeero. Like so many other busy (lazy) computer professionals, I ignored it and did the Ctrl-click Save As… workaround.

Then today, after having been adamantly refusing to upgrade Firefox 2.0.0.19 to 3 (for a host of reasons – though it is installed on my web development testing laptop), I caught, out of the corner of my eye, Firefox unashamedly installing FF 3.0.5 without my consent. I cancelled, went to my prefs, ensured that “automatic updates” was OFF(!!) and happily went about my business. In due course I shut down Firefox, and later re-opened. To be greeted by the message “Firefox is installing updates.” And that was all there was to it. No choice in the matter – bend over this won’t hurt a bit. Of course that meant that my plugins stopped working (what would I do without Firebug??) and since then Firefox has been crashing like Amtrak in winter. Thanks.

So naturally, the next time I was trying to open up a PDF in a browser and got the friendly error message to the effect of “error – The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser. Please exit Adobe Acrobat/Reader and try again.” I LOOOOOSE it. I grabbed my computer in a figure 4 headlock, deaked it out with a headfake to the GPU and slammed an uppercut right up the USB.  “Is that ‘can not be used to view PDF files in a Web Browser’ enough for ya?” I gloated.

Solutions, Tom, not problems please. This is a constructive blog.

Right. So, after reassembling my GPU and rubbing some vaseline on my USB ports, I did some research. Many complains, some very bizarrre solutions (from Adobe) involving clearing out some registry keys, everything quite suspect. The most promising option was to open the Reader Software, go to Preferences > Internet and make sure “View in browser” was turned on. It was – so I turned it off, quit the app, relaunched, turned it on and tried again. Nothing. Not even re-loading the browser solved it.

So I uninstalled, and re-installed Acrobat 8. I found a very helpful Adobe Acrobat 8 standalone installer which has worked without a hitch. So until Adobe gets their act together (I’m completely flabbergasted that their Acrobat 9 for Windows is so crippled and hasn’t been fixed yet), do yourself the favour and do not upgrade. If you have, and are experiencing the same issues, do uninstall Acrobat 9 and then install Reader 8.

Happy surfing!

Read More

So here’s a real doozie that came from a question someone asked on ExpertsExchange: he had two separate Flash Projectors (EXEs) – that needed to be able to intercommunicate (the first projector needed to know when the second projector had actually finished loading). Since we’re dealing with external projector files that have no dependencies (rather than using the movieClipLoader to load an external SWF into the parent movie), the only thing I could think of that would work reliably was local SharedObjects.

As I put together a solution for this brave soul, I encountered a few interesting challenges, and a few frustrations. Thought I’d document it here because I couldn’t find anyone else who had addresses the intricacies of having two SWF share a SharedObject and monitor the status of that shared SharedObject so they could respond to a change in status.

Here’s the basic principle:

  • Application 1 creates a local SharedObject and sets an initial status
  • Application 1 also registers an enterFrame event listener that listens for a status change on the SO
  • Application 2 accesses the same SO and at some point, changes the status
  • Application 1′s enterFrame handler detects the status change, and responds to the event.

As I write this, I see there’s an opportunity for a custom event class that does all this, but I’m going to leave that to the real gurus. I don’t pretend to have that intimate a knowledge of ActionScript to be able to pull that off. I should also point out at this time that the original EE user’s question was for AS2, so this solution is only tested in AS2, though since the issues I was running into were related to variable scope, I would only imaging that an AS3 implementation would be easier, if anything.

Here are the challenges I encountered:

  • how to launch one EXE Projector from another EXE Projector
  • how to share a SharedObject between two Flash movies (SWFs)
  • how to continuously monitor the value of a shared SharedObject
Read More

I had to hunt around for this piece of information, so I’m posting it here for posterity. I have a Motorola V361 cellphone and the accompanying Motorola H350 Bluetooth Headset. But no manuals. Never having used any Bluetooth device in my life, let alone this Borg-like implant, I just couldn’t get anything to work.

Here are some lessons learned:

  • Make sure you enable Bluetooth in your cellphone first. It defaults to off. The Motorola V361 Manual proved quite helpful in this regard. Main Menu > Bluetooth Link > Setup > Power > On.
  • Next you must set your headset in Bluetooth Pairing Mode. For the Motorola H350 / H500, you make sure it’s turned off, and then press and hold the “Phone” button on the front of the device. Hold the button down (for about 10 seconds) until the blue light around the Motorola icon (also on the front of the device) remains lit, solid blue (not flashing). Now you are in “pairing” mode, which enables this to “bond” with other devices.
  • Now, on the cellphone, go to the Bluetooth configuration screen. Main Menu > Bluetooth Link > Handsfree > Detect. This will take about 3 seconds and it will detect your earpiece. Interestingly, it detected it as an H500. Hey who knows, maybe I have an H500 instead. At any rate, now the whole kit and kaboodle works fine.

So there you have it. Setting up your Motorola Bluetooth Headset for the first time.

Read More