Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Robert Tweed
Cedric Muller wrote: in the end, using 'this' or leaving it does make a difference, doesn't it ? I cannot decompile to test my sayings, but 'this' adds more bytecode to the file ?? I'm pretty sure it's just compiled into the same bytecode either way. There are a number of ways to test that,

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Ian Thomas
Unless someone has coded a very odd compiler*, for most compilers of most languages including 'this' won't make any difference to the compiled bytecode. Ian *But then, it _is_ Macromedia. You never know. ;-) On 10/31/05, Cedric Muller [EMAIL PROTECTED] wrote: in the end, using 'this' or

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Cedric Muller
so, people not using 'this' assume something not really achievable in terms of 'technology' ? ;) I cannot decompile to test my sayings, but 'this' adds more bytecode to the file ?? No, if you leave it off, it is added at compile time. Like I said, you can't call methods that aren't

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Cedric Muller
correction/confirmation: 'this' keyword is added everywhere it is needed during compile time. Cedric Muller wrote: in the end, using 'this' or leaving it does make a difference, doesn't it ? I cannot decompile to test my sayings, but 'this' adds more bytecode to the file ?? I'm pretty sure

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Robert Tweed
Ian Thomas wrote: Unless someone has coded a very odd compiler*, ... *But then, it _is_ Macromedia. You never know. ;-) Yes, it _is_ Macromedia :-) For a very odd compiler, look no further than Lingo. - Robert ___ Flashcoders mailing list

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Andreas Rønning
ryanm wrote: I cannot decompile to test my sayings, but 'this' adds more bytecode to the file ?? No, if you leave it off, it is added at compile time. Like I said, you can't call methods that aren't members of an object; all functions must be members of some object. AS1/2 allows you to

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Cedric Muller
this is logical: you assign handleXML function to 'xmlDoc.onLoad' handler which means that 'handleXML' belongs to xmlDoc from now on ... In such cases, I do the following: class ParseXML{ private var xmlDoc:XML; private function handleXML(){ trace(owner); } function

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Andreas Rønning
Why? haha, sorry, but to me it looks like you just added var owner = this just to avoid putting trace(this) for no reason other than avoiding to use this. What's the specific reason you did that? I'm guessing you're smarter than me :) - Andreas Cedric Muller wrote: this is logical: you

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Robert Tweed
Andreas Rønning wrote: 2. What the hell is going on with this here class ParseXML{ private var xmlDoc:XML; private function handleXML(){ trace(this); } function ParseXML(url:String){ xmlDoc = new XML(); xmlDoc.ignoreWhite = true; xmlDoc.onLoad =

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Cedric Muller
I am not smarter than you, oh no! Delegate's smarter than us, and AS3 is King!! (problem solved in the future) I am simply declaring a variable in the class which refers to the class itself. This frees me from the scope trap (using this with 'onLoad') : public function handleXML () {

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Andreas Rønning
Morten Barklund Shockwaved wrote: Andreas Rønning wrote: class ParseXML{private var xmlDoc:XML;private function handleXML(){trace(this);}function ParseXML(url:String){xmlDoc = new XML(); xmlDoc.ignoreWhite = true;xmlDoc.onLoad = handleXML;

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Ian Thomas
On 10/31/05, Morten Barklund Shockwaved [EMAIL PROTECTED] wrote: It is amazing how we can turn back to this first-grade example of understanding scoping in ActionScript almost daily. True - but this highlights a flaw in the language rather than a flaw in the questioner... if the same

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Morten Barklund Shockwaved
Andreas Rønning wrote: [snip] *Yawn* here we go again, another new guy trying to understand this OBVIOUS concept that we've been through so many times already. I can't believe he's bothering us with this again! [snip] Sorry, I was in a bad mood due to other circumstances, had just

Re: [Flashcoders] Newbie AS3 question

2005-10-31 Thread Jon Bradley
Ok. Since I was the 'ass' that started this junk by asking why this was needed, maybe I can be the 'ass' that will end it. This thread started with Andreas asking about addChild. Fair enough. I asked about a specific example that used this on a method which was a member of the same class

Re: [Flashcoders] Newbie AS3 question

2005-10-30 Thread Cedric Muller
] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, October 28, 2005 5:37 PM Subject: Re: [Flashcoders] Newbie AS3 question Well, to me it's the other way around. Code that doesn't use proper references looks messy to me. Whe I'm lazy or in a hurry, I do skip them, but I usually

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread JesterXL
@chattyfig.figleaf.com Sent: Saturday, October 29, 2005 10:19 AM Subject: Re: [Flashcoders] Newbie AS3 question It does a little. Why can't can't you just extend the base CurrencyFormatter class and do the same thing for the formatValue function? Rather than return the correct one for getInstance

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Martin Wood
: Saturday, October 29, 2005 10:19 AM Subject: Re: [Flashcoders] Newbie AS3 question It does a little. Why can't can't you just extend the base CurrencyFormatter class and do the same thing for the formatValue function? Rather than return the correct one for getInstance(), just utilize

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Spike
- From: Spike [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Saturday, October 29, 2005 12:05 PM Subject: Re: [Flashcoders] Newbie AS3 question It's not necessarily any better from an implementation point of view. You can often do the same thing

RE: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Frédéric v . Bochmann
To: Flashcoders mailing list Subject: Re: [Flashcoders] Newbie AS3 question That makes perfect sense and is a good reason. So, from this 2nd conversation, I've gleaned something else to add to the list: - getInstance() is a unspoken standard that implies the class is a Singleton used in other

RE: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Frédéric v . Bochmann
PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Newbie AS3 question You're welcome! This has been an interesting thread and I've learned a bit more about ActionScript in the process :-) Spike On 10/29/05, JesterXL [EMAIL PROTECTED] wrote: That makes perfect sense and is a good

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Weyert de Boer
JesterXL wrote: I didn't know what a Singleton was until AS2 was well underway. I didn't know that it was called a Singleton until Moocks book :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

RE: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Frédéric v . Bochmann
] [mailto:[EMAIL PROTECTED] On Behalf Of JesterXL Sent: October 29, 2005 12:48 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Newbie AS3 question I didn't know what a Singleton was until AS2 was well underway. - Original Message - From: Frédéric v. Bochmann [EMAIL PROTECTED

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Muzak
- Original Message - From: Frédéric v. Bochmann [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Saturday, October 29, 2005 6:32 PM Subject: RE: [Flashcoders] Newbie AS3 question (*Just looking back at the title of this Thread*) Just in case

RE: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Frédéric v . Bochmann
Woah, I never noticed you can private your constructor!! Lol -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muzak Sent: October 29, 2005 1:15 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Newbie AS3 question Well, actually

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread JesterXL
fast, thats why. - Original Message - From: Frédéric v. Bochmann [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Saturday, October 29, 2005 1:18 PM Subject: RE: [Flashcoders] Newbie AS3 question True, nobody called that a Singleton until half way

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread ryanm
The thought of changing multiple lines of code to go from static to non would really suck; that drives the point home for me. Thanks for taking the time to explain it Spike! That's that whole maintainability thing, which, in commercial software, is usually just as or even more important

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread ryanm
Still weirding me out. To me part of the appeal of working with movieclips is their inherent hierarchy, which makes a kind of basic sense that's easy to grasp. To a Flash developer who understands Flash and has been working with it for a long time, that's true. To anyone coming from

RE: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Shaw, Matt
Assuming the Game class is your root/stage class: Public class Game extends MovieClip { public function Game(){ var gameworld:MovieClip = new MovieClip(); //new GameWorld()? this.addChild( gameworld ); var game_bg:MovieClip = new MovieClip();

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Andreas Rønning
Shaw, Matt wrote: Assuming the Game class is your root/stage class: Public class Game extends MovieClip { public function Game(){ var gameworld:MovieClip = new MovieClip(); //new GameWorld()? this.addChild( gameworld ); var game_bg:MovieClip = new MovieClip();

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Spike
Good lord! Why do you say that? It's an extra 2 lines of code and it allows you to reparent any of the children of any of the movie clipse. I'd be more inclined to say it's awesome! Spike On 10/28/05, Andreas Rønning [EMAIL PROTECTED] wrote: Shaw, Matt wrote: Assuming the Game class is

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Jon Bradley
On Oct 28, 2005, at 1:55 PM, Shaw, Matt wrote: Assuming the Game class is your root/stage class: Public class Game extends MovieClip { public function Game(){ var gameworld:MovieClip = new MovieClip(); //new GameWorld()? this.addChild( gameworld ); var

RE: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Shaw, Matt
, 2005 2:54 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Newbie AS3 question On Oct 28, 2005, at 1:55 PM, Shaw, Matt wrote: Assuming the Game class is your root/stage class: Public class Game extends MovieClip { public function Game(){ var gameworld:MovieClip = new

RE: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Geoffrey Williams
You don't need to use the 'this' keyword. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Bradley Sent: Friday, October 28, 2005 2:54 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Newbie AS3 question On Oct 28, 2005, at 1:55 PM, Shaw

RE: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Frédéric v . Bochmann
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shaw, Matt Sent: October 28, 2005 1:55 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Newbie AS3 question Assuming the Game class is your root/stage class: Public class Game extends MovieClip { public function Game(){ var

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread ryanm
I'd be more inclined to say it's awesome! I have to agree, I'm just dissapointed that it doesn't work like that in Flash 8. ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread ryanm
This example makes me wonder: If I was to write this in AS2, it would probably look like: Think of it like this: createEmptyMovieClip is functionally equivilent to new MovieClip PLUS addChild. The benefit of seperating them is that you can add things to and remove things from the display

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Muzak
Wood [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, October 28, 2005 11:03 PM Subject: Re: [Flashcoders] Newbie AS3 question ryanm wrote: What I don't get is why it needs this.addChild instead of just addChild. I've been sick of the keyword

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Andreas Rønning
, Matt Sent: October 28, 2005 1:55 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Newbie AS3 question Assuming the Game class is your root/stage class: Public class Game extends MovieClip { public function Game(){ var gameworld:MovieClip = new MovieClip(); //new GameWorld

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Derek Vadneau
The keyword this makes sense to me. I use it for instance variables. I guess at the end of the day, though, as long as you're consistent anyone can pick up your code. For MovieClip and addChild, is this similar to the way we use XML in AS2? As in, you use createElement, then appendChild?

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Spike
day, there is no point. - Original Message - From: Muzak [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, October 28, 2005 5:37 PM Subject: Re: [Flashcoders] Newbie AS3 question Well, to me it's the other way around. Code that doesn't

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread JesterXL
well. If you do it every day, there is no point. - Original Message - From: Muzak [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, October 28, 2005 5:37 PM Subject: Re: [Flashcoders] Newbie AS3 question Well, to me it's the other way

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread JesterXL
PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, October 28, 2005 6:40 PM Subject: Re: [Flashcoders] Newbie AS3 question ok, so if in AS 3.0 i make an array of new MovieClip() objects, i can choose to only keep one actually instantiated by only adding the one i

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread JesterXL
- From: JesterXL [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, October 28, 2005 6:58 PM Subject: Re: [Flashcoders] Newbie AS3 question Close; the MovieClip IS instantiated, just not drawn. I think Ryan said it best earlier when you think

RE: [Flashcoders] Newbie AS3 question

2005-10-28 Thread Frédéric v . Bochmann
? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of JesterXL Sent: October 28, 2005 6:58 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Newbie AS3 question Close; the MovieClip IS instantiated, just not drawn. I think Ryan said it best earlier when

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread JesterXL
Sent: Friday, October 28, 2005 9:25 PM Subject: Re: [Flashcoders] Newbie AS3 question Naw, I don't know the exact way Singleton is implemented, hence my long battle with finding clarification. It could of been solved in 10 seconds over a beer, but email sux. I figured Math.abs was the Singleton

Re: [Flashcoders] Newbie AS3 question

2005-10-28 Thread JesterXL
Can you elaborate? Why wouldn't the static class work in that case? - Original Message - From: Spike [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, October 28, 2005 9:54 PM Subject: Re: [Flashcoders] Newbie AS3 question ok, That's just