RE: [Flashcoders] OOP Concepts

2006-02-22 Thread thepaulbarton
Brilliant, thanks for all the replies, this kind of advice is just what I
was after. I have a reasonable understanding of OOP regarding Flash but didn?t
want to pick up any ?bad? habits that might work in AS 2 but might hinder
me migrating to another ?stricter? environment in the future. Like Rob I
often relapse into a procedural style and would like to learn best practises
even if I don?t create a class for every clip I ever add to the stage, it
seems better to learn the rules and then see where you can breaking them,
than the other way around.
It?s good to hear the approaches people use in their projects and their general
thoughts on oop in general. Once again thanks.
Paul

-- Original Message --
From: Bjorn Schultheiss [EMAIL PROTECTED]
To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] OOP Concepts
Date: Wed, 22 Feb 2006 09:58:42 +1100
Reply-To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com


After my experience with OOP the strength of OOP is not how you structure
your classes ( which is quite easy ), but rather how they communicate.

Expertise in use of design patterns and creating them mainly comes from
experiencing what works and what doesn't.

With Flash related technologies I think it would pay to start off learning
a
framework like cairngorm.

If you get familiar with utilizing the patterns and concepts they use in
that framework you will be neck deep in OOP with no desire to turn back.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hairy Dog
Digital
Sent: Wednesday, 22 February 2006 1:49 AM
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] OOP Concepts

Thanks for the recommendation Judah.

As you might have figured out, I'm less concerned with the language that
I
use to learn better OOP skills, and more concerned that the language lessens
the chance of getting sloppy.


 -Original Message-
 From: judah [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 21, 2006 9:38 AM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] OOP Concepts

 Rob,

 I would *highly* recommend C# A Programmers Introduction by
 Deitel and Deitel. I had a similar background and it laid a
 framework I could understand. It explained OOP to me better
 than any other book I've read.
 The stuff you will learn from it will help you not only in
 Flash but any other language in the future as well (no I
 don't work for them).

 That will help and just doing it and asking a lot of questions.

 Judah



___
Flashcoders@chattyfig.figleaf.com
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
___
Flashcoders@chattyfig.figleaf.com
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


___

Tiscali Broadband from 14.99 with free setup!
http://www.tiscali.co.uk/products/broadband/


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] OOP Concepts

2006-02-21 Thread Danny Kodicek
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


myClip.setUpButtonFunction()

and then in the timeline of myClip, have a function which says

function setUpButtonFunction() {
myChildClip.onRelease = function() { stuff };
}

It's the same thing, of course, but it's cleaner, because if you ever decide 
to change the name or location of the button, you can do so without 
affecting the interface with the outside world.


Is that what you were asking?

Danny 


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] OOP Concepts

2006-02-21 Thread Meinte van't Kruis
hello,

if you'd want to do it conceptually right OOP-wise, basically you have to
write a class for each nested clip (or one class for all nested clips if
their functionality overlaps).

-Meinte

On 2/21/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 This is my first experience use the mailing List so I hope this makes
 sense!
 My question is more of a conceptual one regarding oop best practises. If
 I have a class which attaches a clip to the stage how can I attach
 functions
 to clips nested inside this clip. Putting code on the attached clip?s
 timeline
 is wrong, I can use;

 myClip.MyChildClip.onRelease = function() { stuff };

 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?

 Cheers,
 Paul

 ___

 Tiscali Broadband from 14.99 with free setup!
 http://www.tiscali.co.uk/products/broadband/


 ___
 Flashcoders@chattyfig.figleaf.com
 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

___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] OOP Concepts

2006-02-21 Thread Meinte van't Kruis
More importantly, there can always be a debate about what is the 'cleanest'
or best 'OOP' way to do stuff (let's not go down that road again ;) ). But
it's good to remember to do things the way you feel most comfortable with,
without losing readability. (which is easy for me to say, considering I'm
the only flasher :) )

-Meinte

On 2/21/06, Julien Vignali [EMAIL PROTECTED] wrote:

 Hi Paul and welcome to the list :)
 I am not an OOP expert, but for me it's more natural for a parent class
 to handle its children events, and forward it to its own parent, etc...

 Most of the time I use this technique :

 import mx.utils.Delegate;

 class MainClip extends MovieClip {
private var nestedClip1:MovieClip;
private var nestedClip2:MovieClip;
private var dispatchEvent:Function;
var addEventListener:Function;
var removeEventListener:Function;

private function init(){
  mx.events.EventDispatcher.initialize(this);
  nestedClip1 = this.attach(NestedChild, child1, depth);
  nestedClip1.onRelease = function(){
// some code here...
  };

  // or you could use a Delegate
  nestedClip2 = this.attach(NestedChild, child2, depth);
  nestedClip2.onRelease = Delegate.create(this, this.onClip2Release);
}

private function onClip2Release():Void {
  // some code here...
  // forward event to any listeners of MainClip
  dispatchEvent({type:doSomething, target:this});
}
 }

 You could also create classes for your nested clips that use
 dispatchEvent() and add your main class as a listener of their clicks
 events...

 Hope it helps..
 Julien

 [EMAIL PROTECTED] a écrit :
  This is my first experience use the mailing List so I hope this makes
 sense!
  My question is more of a conceptual one regarding oop best practises. If
  I have a class which attaches a clip to the stage how can I attach
 functions
  to clips nested inside this clip. Putting code on the attached clip?s
 timeline
  is wrong, I can use;
 
  myClip.MyChildClip.onRelease = function() { stuff };
 
  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?
 
  Cheers,
  Paul
 
  ___
 
  Tiscali Broadband from 14.99 with free setup!
  http://www.tiscali.co.uk/products/broadband/
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  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
 
 ___
 Flashcoders@chattyfig.figleaf.com
 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

___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] OOP Concepts

2006-02-21 Thread Martin Wood



[EMAIL PROTECTED] wrote:

This is my first experience use the mailing List so I hope this makes sense!
My question is more of a conceptual one regarding oop best practises. If
I have a class which attaches a clip to the stage how can I attach functions
to clips nested inside this clip. Putting code on the attached clip?s timeline
is wrong, I can use;

myClip.MyChildClip.onRelease = function() { stuff };

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?


I don't see anything wrong with that. The only thing i would do is to use 
Delegate instead of the function declaration so that you can control the scope 
of execution.


It might make sense to contain the behaviour of this child clip into a class of 
its own if its used for more than just event notification, but theres no hard 
rules as to when you should do this.


Personally I would think about what the child clip is doing. What are its 
responsibilities. If they can be neatly contained in a Class which can 
encapsulate the implementation details away from the users of the child clip 
then I would make a new Class for it.


The only other point to choose here is more a matter of style, do you inherit 
from movieclip or do you use composition.  I avoid inheriting from movieclip 
because i feel its more trouble than its worth once you start creating 
subclasses and dealing with initialization order.


thanks,

Martin
___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] OOP Concepts

2006-02-21 Thread Danny Kodicek



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.


I'm much the same as you, and probably not the best person to ask! My OOP 
style is... shall we say 'idiosyncratic'? And as a Lingo person I'm used to 
doing things a bit back-to-front in any case (Director's inheritance model 
is a little strange).


People can get a bit bogged down in 'correct' ideas about OOP, in my 
opinion, with theoretical arguments about 'is-a' versus 'has-a' and so on. 
But the basic principle of 'keep the information where it's useful' and 
'remember who knows what when' is the key.


I did find the book 'surviving object-oriented projects' quite interesting, 
although it's mostly aimed at large-scale projects with a large team, and 
very data-driven.


Danny 


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] OOP Concepts

2006-02-21 Thread Ian Thomas
Paul,

Just my two penn'orth...

For my money, the best way to think about these things is more on a
conceptual level rather than specifically at a code level. What is your
child movieclip? What does it do?

Best example I can think of is off the top of my head is, say, a requester
dialog. Say a simple dialog that just asks the user to confirm Yes or No in
answer to a question. Let's call this ConfirmDialog.

From a top-level point of view, all your top-level movie clip really cares
about is saying to ConfirmDialog please pop up, ask a specific question,
and tell me what the user answered. Your movie doesn't care _how_
ConfirmDialog actually achieves that, it just wants to know the answer. So
that gives you a pretty clear indication of the division of responsibilities
- your top-level movie doesn't care whether ConfirmDialog uses buttons,
MovieClips, or a text entry box. It also doesn't care what those things are
called.

That might point you to this sort of implementation (just an example - there
are an infinite number of ways of doing this):
- Parent creates a ConfirmDialog
e.g. var myConfirmDialog:ConfirmDialog=ConfirmDialog(attachMovie(blah));
- Parent tells the ConfirmDialog what question to ask, and what function to
call when the question is answered:
e.g myConfirmDialog.setQuestion(Are you really sure about that?);
 myConfirmDialog.setCallback(Delegate.create(this,onQuestionAnswered));
- Parent hands control over to the dialog:
myConfirmDialog.show();
- Then ConfirmDialog does whatever it wants to internally - creates its own
buttons. It could set event listeners on buttons, could set onRelease etc.
These event listeners will call back into ConfirmDialog's own code. Then
ConfirmDialog will call the parent back with the answer - using
onQuestionAnswered(true) or onQuestionAnswered(false)

Does that make any sort of sense?

Like I said, that's one way of doing it - you could do it with event
listeners, you could do it any old how. The important thing to think about
is the division of responsibilities. It's back to that old black box
metaphor - the containing movie really shouldn't care about the inside of
ConfirmDialog, only that it's putting in specific inputs (the question, the
callback) and getting specific things back out again. Likewise,
ConfirmDialog shouldn't care who's calling it - just that it's getting
particular inputs, doing its own thing, then spitting out an output.

This sort of strategy is the basis of componentisation, and is handy for all
sorts of reasons. It means you could re-use that ConfirmDialog code in any
number of different places. It also means that you could replace the
ConfirmDialog code with some completely different input method (say a
Switch-enabled dialog of some sort) and the parent code wouldn't care that
it had changed.

Of course, one step better is if the parent code doesn't even know it's
calling/attaching a movie clip. If you had a whole ConfirmDialogHandler
class that your parent knows about - the parent just goes:
var myHandler:ConfirmDialogHandler=new ConfirmDialogHandler();
myHandler.ask(Are you sure you want to do this?,Delegate.create
(this,onQuestionAnswered));

Then it's up to ConfirmDialogHandler how it does it - it could pop up a
movie clip, it could read out some text, it could 'phone the user up and
squawk in Morse code at him... err...

Well, you get the idea.

Hope that clarifies it a bit,
  Ian


On 2/21/06, Martin Wood [EMAIL PROTECTED] wrote:



 [EMAIL PROTECTED] wrote:
  This is my first experience use the mailing List so I hope this makes
 sense!
  My question is more of a conceptual one regarding oop best practises. If
  I have a class which attaches a clip to the stage how can I attach
 functions
  to clips nested inside this clip. Putting code on the attached clip?s
 timeline
  is wrong, I can use;
 
  myClip.MyChildClip.onRelease = function() { stuff };
 
  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?

___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] OOP Concepts

2006-02-21 Thread Hairy Dog Digital


 I'm much the same as you, and probably not the best person to 
 ask! My OOP style is... shall we say 'idiosyncratic'?

That's why I thought I'd expose my soft, white underbelly here on the forum.

I would imagine that mine would be quirky. I'm not looking for the pinacle
of OOP practices, not do I want to start a best practices debate. 

 And as 
 a Lingo person I'm used to doing things a bit back-to-front 
 in any case (Director's inheritance model is a little strange).

LOL. At least you venture down that path with Lingo. The Lingo in many of my
small Director projects look like glorified Hypercard projects, just with
better media asset handling!

...Rob


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] OOP Concepts

2006-02-21 Thread judah

Rob,

I would *highly* recommend C# A Programmers Introduction by Deitel and 
Deitel. I had a similar background and it laid a framework I could 
understand. It explained OOP to me better than any other book I've read. 
The stuff you will learn from it will help you not only in Flash but any 
other language in the future as well (no I don't work for them).


That will help and just doing it and asking a lot of questions.

Judah

Hairy Dog Digital wrote:


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




___
Flashcoders@chattyfig.figleaf.com
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

 




--
Always bear in mind that your own resolution to succeed is more important than any 
one thing.

You can have anything you want - if you want it badly enough. You can be anything you want to be, do anything you set out to accomplish if you hold to that desire with singleness of purpose. 


- Abraham Lincoln

___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] OOP Concepts

2006-02-21 Thread Igor Vasiliev
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




___
Flashcoders@chattyfig.figleaf.com
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
___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] OOP Concepts

2006-02-21 Thread Igor Vasiliev
Sorry ppl for my prev. post.

When I wrote 4 Rob I means 4 Hairy Dog Digital
And 4 Danny actually points to Paul (the first post)

Sorrry once again :)

Igor V. a.k.a. The Helmsman
www.mixtv.tv 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, February 21, 2006 2:39 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] OOP Concepts

This is my first experience use the mailing List so I hope this makes sense!
My question is more of a conceptual one regarding oop best practises. If I have 
a class which attaches a clip to the stage how can I attach functions to clips 
nested inside this clip. Putting code on the attached clip?s timeline is wrong, 
I can use;

myClip.MyChildClip.onRelease = function() { stuff };

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?

Cheers,
Paul

___

Tiscali Broadband from 14.99 with free setup!
http://www.tiscali.co.uk/products/broadband/


___
Flashcoders@chattyfig.figleaf.com
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
___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] OOP Concepts

2006-02-21 Thread Hairy Dog Digital

 4 Rob
 
 I can recommend to read
 Essential ActionScript 2.0
 By Colin Moock 

Thanks Igor. That book's been on my shelf, since it was published.



___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] OOP Concepts

2006-02-21 Thread Hairy Dog Digital
Thanks for the recommendation Judah.

As you might have figured out, I'm less concerned with the language that I
use to learn better OOP skills, and more concerned that the language lessens
the chance of getting sloppy. 


 -Original Message-
 From: judah [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, February 21, 2006 9:38 AM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] OOP Concepts
 
 Rob,
 
 I would *highly* recommend C# A Programmers Introduction by 
 Deitel and Deitel. I had a similar background and it laid a 
 framework I could understand. It explained OOP to me better 
 than any other book I've read. 
 The stuff you will learn from it will help you not only in 
 Flash but any other language in the future as well (no I 
 don't work for them).
 
 That will help and just doing it and asking a lot of questions.
 
 Judah



___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] OOP Concepts

2006-02-21 Thread Bjorn Schultheiss
After my experience with OOP the strength of OOP is not how you structure
your classes ( which is quite easy ), but rather how they communicate.

Expertise in use of design patterns and creating them mainly comes from
experiencing what works and what doesn't. 

With Flash related technologies I think it would pay to start off learning a
framework like cairngorm.

If you get familiar with utilizing the patterns and concepts they use in
that framework you will be neck deep in OOP with no desire to turn back.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hairy Dog
Digital
Sent: Wednesday, 22 February 2006 1:49 AM
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] OOP Concepts

Thanks for the recommendation Judah.

As you might have figured out, I'm less concerned with the language that I
use to learn better OOP skills, and more concerned that the language lessens
the chance of getting sloppy. 


 -Original Message-
 From: judah [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, February 21, 2006 9:38 AM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] OOP Concepts
 
 Rob,
 
 I would *highly* recommend C# A Programmers Introduction by 
 Deitel and Deitel. I had a similar background and it laid a 
 framework I could understand. It explained OOP to me better 
 than any other book I've read. 
 The stuff you will learn from it will help you not only in 
 Flash but any other language in the future as well (no I 
 don't work for them).
 
 That will help and just doing it and asking a lot of questions.
 
 Judah



___
Flashcoders@chattyfig.figleaf.com
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
___
Flashcoders@chattyfig.figleaf.com
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