[Flashcoders] AS2.0 Question - passing data between classes

2007-04-23 Thread Andrew
Hi I'm new to OOP programming in AS2. I'm writing two classes right now. One which creates/manipulates an array of XMLNodes and one which watches for an internet connection. When it finds a connection, it starts to send the XMLNodes from the queue back to a server one by one. So far I've wr

[Flashcoders] AS2.0 Question - passing data between classes

2007-04-24 Thread Andrew
Is there also some way to do this using a command called getinstance() ? I've seen it in some AS script and it looks like it passes data between classes? Cheers Andrew ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or searc

Re: [Flashcoders] AS2.0 Question - passing data between classes

2007-04-23 Thread Russell Sprague
What I would do is have the Queue class be a listener of the connection class, and not pass that data at all. When a connection is detected, a notice is fired off to the listeners (the Queue class). You can send the connection info in the message to the Queue, then in the Queue class can the

Re: [Flashcoders] AS2.0 Question - passing data between classes

2007-04-23 Thread T. Michael Keesey
On 4/23/07, Andrew <[EMAIL PROTECTED]> wrote: Hi I'm new to OOP programming in AS2. I'm writing two classes right now. One which creates/manipulates an array of XMLNodes and one which watches for an internet connection. When it finds a connection, it starts to send the XMLNodes from the queue b

Re: [Flashcoders] AS2.0 Question - passing data between classes

2007-04-23 Thread Ron Wheeler
You might want to read "Head First Design Patterns" for some good ideas about how to write good code. Lots of practical ideas about many of te situations that you need to resolve. Ron Andrew wrote: Hi I'm new to OOP programming in AS2. I'm writing two classes right now. One which creates/ma

Re: [Flashcoders] AS2.0 Question - passing data between classes

2007-04-24 Thread Ron Wheeler
I do not think that this passes any data but it does let you grab an instance (usually of a singleton) so that you can use setters and getters to pass the data. If the object is not a Singleton, I am not sure which instance you get so it is only part of the solution. Look at the book "Head Fir

Re: [Flashcoders] AS2.0 Question - passing data between classes

2007-04-24 Thread Andy Herrman
getInstance() is usually used for accessing Singleton classes. These are classes of which only a single instance can exist. This way any class can call getInstance (a static method) to get the class, and that class can store shared data. Take a look at this: http://en.wikipedia.org/wiki/Singlet

Re: [Flashcoders] AS2.0 Question - passing data between classes

2007-04-24 Thread R�kos Attila
A> Is there also some way to do this using a command called getinstance() ? A> I've seen it in some AS script and it looks like it passes data between A> classes? There is no such method in Flash's built-in classes, so propably it occured in someone's custom class. In general getInstance is a co