4 Rob>
I can recommend to read
Essential ActionScript 2.0
By Colin Moock
This is the best book I know that covers OOP in Flash environment.
4 Danny>
There are nothing wrong to use both techniques.
I've asked many people I work with about best practices to code and most of
them used mixed approach, I mean they use OOP when they need objects and
procedural-style to make rest of things. I think there is something in using
both methods, cause the OOP needs some planning and it's good to create big
systems flexible for maintence and updates, but ther are no need to create
objects when you actually don't need them. For example: you can make something
like
function sum(x:Number, y:Number):Number {
return x+y;
}
More quickly then:
class Math {
public var x:Number;
public var y:Number;
public function Math(x:Number, y:Number) {
this.x = x;
this.y = y;
}
public sum():Number {
return x*y;
}
}
Therefore don't be ashamed when you going to use some simple techniques in your
code.
Actually simple things usually better then complex, especially when the complex
one needs to make some planning before.
Igor V. a.k.a. The Helmsman
www.mixtv.tv
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hairy Dog Digital
Sent: Tuesday, February 21, 2006 3:59 PM
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] OOP Concepts
Danny,
> >It works, but seems fundamentally wrong, as I understood it was bad
> >practise
> to add methods to an object dynamically. Should I make the class
> listen for clicks on the nested clip or is there another solution?
>
> There's nothing wrong with adding methods to an object dynamically.
> What's slightly dodgy is 'talking to' a child or property of an object
> directly.
> It's better OO practice for the object to be in charge of its own
> properties, and to talk to it by some kind of accessor method. So you
> might say
The original post and your reply, raised a question in my mind.
I got my start in programming with languages like Basic, Pascal, and C (no, not
C++ or C#). I latched onto Hypercard and Supercard in the beginning of the 90s.
(Yeah, I'm showing my age.) Later, as the web moved into the commercial sector,
I got into JavaScript, followed by Director and Flash.
I brought with me a lot of line-by-line coding bad habits. As much as I
understand OOP and try to utilize OOP in my projects, I often relapse into
"scripting" mode simply because it is natural to me.
Would you -- or anyone else out there -- have a good self-study book, web site,
online course, or other general recommendation, for breaking me out of my
existing mind set? It's got to be straightforward enough so that I grasp it,
but not so easy that I get bored by "Hello World" exercises (eg, Sam's "Teach
Yourself in 24 Hrs"), or so didactic that my intelligence is insulted (eg,
"_____ for Dummies").
My first thought was to jump into Java or some other environment that will
inhibit my ability to fall off the OOP wagon, so I picked up the books "Head
First Java" and "Head First Design Patterns" and am just starting to devour
them.
Thoughts? Suggestions?
FWIW, I did pick up the book
...Rob
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com