Robert Penners programming FMX book

Hey, I just picked up this book because of all the great stuff I’ve heard about it, and I was wondering if there is anything in here that would be considered “bad practice” now with Flash MX 2004 being out. In chapter 2 it goes over a lot of Object Oriented programming techniques which include things like constructor and his custom ways of finding the constructor, as well as the use of proto instead of new. Also his extend(); function


Function.prototype.extend(superclass){
this.prototype.__proto__ = superclass.prototype;
this.prototype.__constructor__ = superclass;
}

and superCon(); funciton


Child.prototype.superCon = function(){
  arguments .caller.prototype.__proto__.constructor.apply(this,arguments);
}

were two that worried me a little as far as “am I learning outdated stuff that will just confuse me when it no longer works” (which I hate being victim to)

Any comments or suggestions as far as what to ignore/do “better” would be appreciated.

perhaps better in FMX2004 forums, but never mind :slight_smile:

proto should definitely not be used in FMX2004. I think you weren’t even supposed to use it in MX - it was only there to work around a ‘quirk’ in the way FMX handles OOP.

I can’t provide any more info, as I’m terrible at OOP. I’m sure Sen will see this though :wink:

Well, thanks for the proto confirmation anyway, I was pretty sure that was a no no =D.