gt; }
> }
>
> class UKCurrencyFormatter extends CurrencyFormatter {
>
> public formatValue(val:Number) {
> // very simplistic formatting
> return "£" + String(val);
> }
> }
>
> }
>
> Let me know if that explains it a bit better.
>
> Sp
explains it a bit better.
>
> Spike
>
>
> On 10/29/05, JesterXL <[EMAIL PROTECTED]> wrote:
> >
> > Can you elaborate? Why wouldn't the static class work in that case?
> >
> > - Original Message -
> > From: "Spike" <[EMAIL PROT
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
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
explain
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 no
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;
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 () {
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;
xmlDoc.load(url);
}
}
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 = handleXM
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
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 Pars
On 10/31/05, Andreas Rønning <[EMAIL PROTECTED]> 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.o
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 *p
*grin* As a reformed Director user - my point exactly.
On 10/31/05, Robert Tweed <[EMAIL PROTECTED]> wrote:
>
> 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",
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
Flash
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 i
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 member
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 le
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, a
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 *pretend* like yo
rom: "Muzak" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
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
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 another
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 th
nt: October 29, 2005 1:35 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Newbie AS3 question
Had I been formerly trained in programming, I'm sure I would of known what a
Singleton was years ago, and called it such before AS1 was called AS1.
However, since I had to learn h
es so fast,
thats why.
- Original Message -
From: "Frédéric v. Bochmann" <[EMAIL PROTECTED]>
To: "'Flashcoders mailing list'"
Sent: Saturday, October 29, 2005 1:18 PM
Subject: RE: [Flashcoders] Newbie AS3 question
True, nobody called that a Singleton
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 there is a
ge-
From: [EMAIL PROTECTED]
[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: "
- Original Message -
From: "Frédéric v. Bochmann" <[EMAIL PROTECTED]>
To: "'Flashcoders mailing list'"
Sent: Saturday, October 29, 2005 6:32 PM
Subject: RE: [Flashcoders] Newbie AS3 question
> (*Just looking back at the title of this Thread*)
>
&g
ge-
From: [EMAIL PROTECTED]
[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: "
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
http://chattyfig.figleaf.com/mailman/li
I didn't know what a Singleton was until AS2 was well underway.
- Original Message -
From: "Frédéric v. Bochmann" <[EMAIL PROTECTED]>
To: "'Flashcoders mailing list'"
Sent: Saturday, October 29, 2005 12:32 PM
Subject: RE: [Flashcoders] Newbie
12:25 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
PM
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
use
point home for me. Thanks for taking
> the
> time to explain it Spike!
>
> - Original Message -
> From: "Spike" <[EMAIL PROTECTED]>
> To: "Flashcoders mailing list"
> Sent: Saturday, October 29, 2005 12:05 PM
> Subject: Re: [Flashcoders] Newbie AS3 questi
suck; that drives the point home for me. Thanks for taking the
time to explain it Spike!
- Original Message -
From: "Spike" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
Sent: Saturday, October 29, 2005 12:05 PM
Subject: Re: [Flashcoders] Newbie AS3 ques
It's not necessarily any better from an implementation point of view. You
can often do the same thing with a static class as you can with a singleton.
The big benefit comes if you need to change from singleton/static to
different instances for each invocation.
If you have followed the static clas
s, and how this applys to the Singleton pattern.
- Original Message -
From: "Martin Wood" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
Sent: Saturday, October 29, 2005 11:02 AM
Subject: Re: [Flashcoders] Newbie AS3 question
but using Composition and
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
s mailing list"
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 getIns
.getFormat();
and:
var val = USCurrencyFormatter.getFormat();
?
- Original Message -
From: "Spike" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
Sent: Friday, October 28, 2005 10:31 PM
Subject: Re: [Flashcoders] Newbie AS3 question
Sure,
Here's a
Why wouldn't the static class work in that case?
>
> - Original Message -
> From: "Spike" <[EMAIL PROTECTED]>
> To: "Flashcoders mailing list"
> Sent: Friday, October 28, 2005 9:54 PM
> Subject: Re: [Flashcoders] Newbie AS3 question
>
>
> ok,
>
Can you elaborate? Why wouldn't the static class work in that case?
- Original Message -
From: "Spike" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
Sent: Friday, October 28, 2005 9:54 PM
Subject: Re: [Flashcoders] Newbie AS3 question
ok,
That
> public static function getData()
> {
> // Simple function that gets something from the server.
> }
> }
>
> Then to use:
>
> ServerConnection.connect(myURL, myPort);
>
> - Original Message -
> From: "JesterXL" <[EMAIL PROTECTED]>
> To: &
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 Sing
d before making a
method call, else throw an exception.
Are they both the Singleton pattern? Does it matter?
- Original Message -
From: "Spike" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
Sent: Friday, October 28, 2005 7:14 PM
Subject: Re: [Flashcode
I always understood that the richtext support of Flash sucks, but I
suppose to be mistaken? I always hear people complaining about images etc.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/f
.visible = !this.visible;
> > }
> > }
> >
> > To each their own. I can see it justified in extending intrinsic
> classes,
> > as the first parameter to setInterval, and the first parameter in
> > Delegate.
> >
> > AS3 and Flex both hammer the point that
October 28, 2005 7:07 PM
Subject: Re: [Flashcoders] Newbie AS3 question
Can't we use DisplayList to make our own richtext editor in Flash?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig
Can't we use DisplayList to make our own richtext editor in Flash?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
y.
Anyone know?
-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
be
ssage -
From: "JesterXL" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
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
Bedar" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
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
eally has little use other
> than confirming for those programmers who are not familiar with
> ActionScript. Same goes for the Singleton.method vs.
> Singleton.getInstance().method argument; the latter is for those
> programmers
> who don't know ActionScript well.
>
> If you
-Original Message-
From: [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] On Behalf Of Andreas
Rønning
Sent: Friday, October 28, 2005 1:08 PM
To: Flashcoders mailing list
Subject: [Flashcoders] Newbie AS3 question
AS3 noob question ahoy!
I'm reading the AS3 reference trying to get accusto
From: "Derek Vadneau" <[EMAIL PROTECTED]>
To:
Sent: Friday, October 28, 2005 5:58 PM
Subject: Re: [Flashcoders] Newbie AS3 question
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'r
goes for the Singleton.method vs.
> Singleton.getInstance().method argument; the latter is for those
> programmers
> who don't know ActionScript well.
>
> If you do it every day, there is no point.
>
> - Original Message -
> From: "Muzak" <[EMAIL PROTE
x27;t know ActionScript well.
If you do it every day, there is no point.
- Original Message -
From: "Muzak" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
Sent: Friday, October 28, 2005 5:37 PM
Subject: Re: [Flashcoders] Newbie AS3 question
Well, to me
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?
I
n a hurry, I do skip them, but I usually find myself adding
them afterwards anyway.
So, I'm with ryanm on this one ;-)
regards,
Muzak
- Original Message -
From: "Martin Wood" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
Sent: Friday, October 28,
om: [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
-
From: "Martin Wood" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
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"
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 disp
ryanm wrote:
What I don't get is why it needs "this.addChild" instead of just
addChild. I've been sick of the keyword "this" for a long time and
have since avoided it in AS2.
Any reason that it needs to be back in for AS3?
Maybe because it's one of the most useful scope references ever
What I don't get is why it needs "this.addChild" instead of just addChild.
I've been sick of the keyword "this" for a long time and have since
avoided it in AS2.
Any reason that it needs to be back in for AS3?
Maybe because it's one of the most useful scope references ever
invented?
T
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
http://chattyfig.figleaf.com/mailman/listinfo/flash
riginal Message-
From: [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 MovieCl
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, a
"Flashcoders mailing list"
Sent: Friday, October 28, 2005 2:53 PM
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 fu
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, Matt wrote:
> Assuming the Game class is your root/stage class:
>
>
> Public class Game extends MovieClip {
> public function Game(){
&
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 game_bg:Movi
;
> > var game_bg:MovieClip = new MovieClip();
> > gameworld.addChild( game_bg );
> >}
> >
> >
> >
> >-Original Message-
> >From: [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] On Behalf Of Andreas Rønning
> >Sent: Friday, October 28, 2005 1:08 PM
();
gameworld.addChild( game_bg );
}
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas Rønning
Sent: Friday, October 28, 2005 1:08 PM
To: Flashcoders mailing list
Subject: [Flashcoders] Newbie AS3 question
AS3 noob question ahoy!
I'm readin
();
gameworld.addChild( game_bg );
}
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas Rønning
Sent: Friday, October 28, 2005 1:08 PM
To: Flashcoders mailing list
Subject: [Flashcoders] Newbie AS3 question
AS3 noob question ahoy!
I'm reading the AS3 reference t
AS3 noob question ahoy!
I'm reading the AS3 reference trying to get accustomed to the idea, but
some things (though they look better) i don't really get right away :)
Hence my feeling of incredible stupidity.
I realise the AS3 in the reference is Flex-related, but in Flash IDE
terms, how woul
74 matches
Mail list logo