David A. Molanphy

Design + Interactive Strategy 

You're Fired! When to fire your clients.

I have worked in many different places in many different capacities, including owning my own business for a brief stint. I know first-hand the problems with keeping a bad client - regardless of how much value you believe they are bringing to your company. I have worked at places where we have lost several of the best people we had because the morale of working with one of these problematic clients is so low. This is a great article to help you determine when you should fire your clients - yes, even in this economy!

Comments [0]

AS3 Tip: Access variable of parent

Quick AS3 tip that may be self-explanatory to most of you out there, yet stumped me for a while. In AS2, if you set a variable on your main timeline and wanted to access it from inside a movieclip, all you would need to do is call it by name. AS2 would then proceed up the scope chain looking for the variable by name. First, inside the movieclip, then on the parent of the movieclip (in this case...stage). AS3 is a little different. Say you declare a variable on your main timeline like so: var my_arr:Array = ["one", "two", "three", "four"]; Then you place a movieclip on your stage, and INSIDE your movieclip, you want to reference my_arr (which is on the main timeline, or the movieclip's parent). Back in AS2, you would simply type out my_arr, and Flash would automagically find the variable as it searched the scope chain. In AS3, however, if you type this (again...inside the movieclip): trace (my_arr); or even trace(this.parent.my_arr); You would get this error: 1119: Access of possibly undefined property my_arr through a reference with static type flash.display:DisplayObjectContainer. Well, to avoid this little annoyance, you can try a strict coercion like so: trace (MovieClip(this.parent).my_arr); I wish I knew the exact reason as to why this behavior exists, but I do have my suspicions and theories in case you're interested. What I believe is happening is that in AS3, the movieclip doesn't want to assume it knows what its parent is. In fact, as far as it's concerned, it only worries about whatever is in it, or "below" it (the concept is called encapsulation). Anything outside of it (or "above" it) is basically anybody's guess and unless you specifically tell it "your parent is a movieclip," it doesn't make any assumptions. Again, that's my own theory - so if anyone out there knows the real reasons for this behavior (or even a better way of handling this) - let us know!

Filed under  //   actionscript   flash   tips  

Comments [0]

Flash CS4 + F1 Help Files

I recently got upgraded to CS4 at work and for the most part, the many changes that have taken place in Flash have been pretty cool. I'm having trouble adjusting to the new interface (in particular, having the timeline be at the bottom of the screen vs. the top). Many of the changes have been requested for years - like more AfterEffects integration, 3D, etc. And to be honest, Adobe has delivered some pretty cool new features. Now for the bad news. As is always the case (or so it seems), every major release comes with its own baggage and behavior that isn't so welcome. For me (and many others), it's the new CS4 help system – or lack thereof. It turns out that the folks at Adobe decided that if you're looking for help, you should be going to their servers — you know...those slow snail-paced things that adobe.com is hosted on — and get your answers there. The help that we've all grown accustomed to is now gone, and to quote Bentley Wolfe, an Adobe engineer "The old help format is gone, and not coming back. Sorry." Nice. So there you have it. If you're like me and use the help files constantly as a reference while developing in the Flash IDE, stick to CS3. Otherwise, if you don't mind waiting for the slow server to load, then finding the right section, then searching for a class or function, then sorting through irrelevant search results until you find something the resembles what you're looking for, then realizing it's not it and starting another search, and finally finding something that is already confusing to begin with...well then, be my guest. :) More on CS4 later. [ update ] Well, thanks to David Stiller in this thread, I now at least have access to the local help files when pressing F1 - though it still opens in a browser. Here's how you do it: 1. Go to Window/Extensions/Connections 2. Click on the context menu (upper right-hand corner) 3. Select "Keep me offline" 4. You're good to go. Now when you press F1, the browser will open and look for the local files.

Filed under  //   actionscript   flash   tips  

Comments [0]

Quick AS3 Tips

As mentioned in my previous post, some things about AS3 are finally beginning to click. Others are still dark and murky, but we are all fortunate to have lots of smart people figuring things out and posting them online for the rest of us. In an effort to further their efforts (and to document some of these things for myself so I'm not hunting for them frantically next time I forget them), here are some simple tips I have found:

Stage=null

I ran into this one today. I was trying to preload a swf into another swf and everything seemed to work fine, except when I tried to simulate download speed so I could preview my work. As soon as I tried simulating the download, AS3 would spit out this cryptic error: TypeError: Error #1009: Cannot access a property or method of a null object reference. Which translated into plain speak means: Stage = null. The error happens because on the swf I'm loading, I have several references to the stage (such as stage.stageWidth, etc). Well, since nothing has been added to the displayObject yet (I'm assuming), AS3 is kindly pointing out the error of my ways. Problem is, I need to figure out the width of my stage as soon as my movie starts! Google to the rescue: Mark Ledford explains in more detail what the problem is - but more importantly, here's the fix (which was actually posted by Steven Sacks – in a somewhat arrogant tone I might add): if (stage == null) { addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); } else { onAddedToStage(); } private function onAddedToStage(event:Event = null):void { // init code that requires stage }

Clear out an object

I can't remember where I found this one, but the problem/solution is simple. Say you need to make sure an object has only one child (and for some reason it has something in it already). Simply clear out the object with this: function clearObjectChildren(which:Object):void { while (which.numChildren > 0) { which.removeChildAt(which.numChildren-1); if (which == null ) break; } }

onReleaseOutside in AS3

One of my gripes about AS3 is that many simple concepts were replaced by ridiculous complexity. Such is the case with the onRelease function that used to exist in AS2. If you're looking for it in AS3, good luck. It's gone. So what do we do when we're dragging something (like a slider) and want to make sure it stops dragging correctly? We add an eventListener to the stage. (random, but it works). slider_mc.buttonMode = true; slider_mc.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); function mouseDownHandler(e:MouseEvent):void { var bounds:Rectangle = new Rectangle(0, 0, 100, 0); slider_mc.startDrag(false, bounds); stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); } function mouseUpHandler(e:MouseEvent):void { stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); slider_mc.stopDrag(); }

Using names

Another big difference between AS2 and AS3 that took me some time to figure out was instance names. In AS2, you named everything on the stage (and off) using instance names or variables. In AS3, if your item is physically on the stage (i.e. a movieclip you created on the stage), you can still reference it by instance name, however...if you are creating an object dynamically, you will need to implicitly add a name to it like so: my_mc.name = "my_mc"; So if you need to access an mc by name (because you're not sure what number it is in the display line), you can look for it like this: some_mc.getChildByName("my_mc"); Makes sense really. So those are some of the things I've learned so far. There are plenty more, but I'm gonna stop while I'm ahead and put some more up later. Hope this helps someone out there. :)

Filed under  //   actionscript   flash   tips  

Comments [0]

Bare Bones Strikes Back with BBEdit 9.0

A little bit ago I wrote some quick thoughts on Coda vs. TextMate vs. BBEdit and had all but removed BBEdit from my list of preferred text editors for the Mac. But the good folks at Bare Bones are saying "not so fast buster"! They have just released BBEdit 9.0 and I'm happy to say that it is worth another look! With this new version, BBEdit has re-joined the party (at least in my book) with a whole boatload of great features — the first of which you will notice will be a big overhaul of their UI (thank you). And speaking of overhauls, they've also re-done their site — which has been long overdue in my opinion. But that's not all folks! Here are three features that I'm most excited about:

  • Projects: view all files in a project on the same window (finally)
  • Search/Replace: Not only have they improved the look of this essential feature, they have also added the ability to edit right on the results - a feature that has been requested for years.
  • Code Completion: One of my favorite things about both Coda and TextMate is code completion. Anything to save time on repetitive tasks! BBEdit's implementation is nice and robust – and good lookin' too
And that's just the beginning! Bare Bones must've realized that they were falling way behind on nice-to-have features and they have come back into the fight swingin' like mad. However, with all the niceties of the shiny new v9, they still have some skeletons in the closet — the preference pane. Somebody please do something about this! Price could use a little help too.

Comments [0]

Loading Multiple Images in AS3

As I venture into the depths of AS3 – I find myself pulling my hair out yet again (and those of you who know me know I have no hair left, so that's not a good thing). Loading multiple images in Flash is (in my opinion) one of the most basic tasks you should be able to perform – and yet I have struggled with this for the past several hours in AS3. This will be basic knowledge to many of you, but bare with me.

Read the rest of this post »

Comments [0]

Painfully true...

I cannot begin to tell you how painfully true this is. The other thing I get a lot of is "Oooh! I have this idea for a cool website! Can you do it?." The answer is always no.

Comments [0]

CalDAV support on Google Calendar

If you use your Google Calendar on your iPhone or Blackberry, CalDAV support might be of interest to you [update: or not]. You might also consider third-party alternatives (which I have not tried, but hear are very good). [update: anyone else getting a "calendar not found" error?] [update: hmm...seems to be back up for me. Google is such a tease.]

Comments [0]

Web 3.0 is here says Benioff

Salesforce's CEO (Marc Benioff) – speaking on what he believes is the next wave of innovation to the internet – claims the era of Web 3.0 has already begun. Although the article very much feels like Salesforce trying to establish their leadership position, Benioff makes some good points with which I agree. Making predictions is always a risky business (particularly in technology) but the idea of entrepreneurs not having to worry about data infrastructure anymore makes more sense when you see the success of companies who are already "renting" their computing power (Amazon S3, Google App Engine, Salesforce) for pennies – making computing on the cloud not only possible and reliable, but accessible to anyone.

Comments [0]

Flash loves Google

One of the most difficult problems to overcome whenever selling the idea of a Flash site is the almighty Search Engine Optimization issue — and rightly so. After all, if your audience can't find your site, who cares if it's the mother of all Flash sites? Granted, I think SEO can be taken to an unhealthy level and as with all things, the key is to balance relevant content with keywords and Google-food. But that's a whole different post. Adobe has long been trying to overcome the issue of Flash indexing and there have been a number of homegrown solutions that have made things slightly more usable. But the good folks at Adobe have taken it a step further and provided the major search engines with their very own version of the Flash Player — which can dig deep into the bowels of your movies and extract key information. It is rumored that Google has already implemented this new player into their system and Yahoo is following shortly thereafter. So what does this mean really? Well, difficult to say until we understand exactly how to tap into this functionality (much like the way you build an HTML site affects your search engine visibility, I would assume that the way you build your Flash site will affect how this tool indexes your movies). Regardless, this is a very welcome move by the powers that be. And while I'm on the subject of Flash and SEO, don't forget there are other tools out there that help Flash sites become much more usable: Track Flash events using Google Analytics Better browser integration and deep-linking with SWFAddress Better Flash object embedding with SWFObject Accessible Flash type with SiFR Image replacement with swfIR Happy Flashin'!

Comments [0]