Actually I wouldnt mind betting that code of yours would run without any error at all, native types are passed by value not reference.
--- In flexcoders@yahoogroups.com, "johantrax" <[EMAIL PROTECTED]> wrote: > > I think you still pretty much get the concept of const. > It means the value of yyy cannot be changed after initialisation. > > To actually see it used in methods like this.. I assume the example > you gave is a bit 'stripped down' :p > If I get it correctly, everything is ActionScript is passed by > reference, so to expand your example a bit: > > function xxx() { > const yyy:Number = 99; > abc(yyy); > } > function abc(zzz:Number) { > zzz *= 10; > } > > Not big of an example, not even sure if it's correct. But when this is > done I assume an error will be thrown, saying that the assignment to > zzz in function abc is illegal for the argument yyy, being const. > > However this is an assumption, based on how I used const in other > programming languages. I have no experience with it in AS > > --Johan > > --- In flexcoders@yahoogroups.com, "reflexactions" <reflexactions@> > wrote: > > > > I thought I understood the meaning and use of const until.... > > > > I saw Adobe use it inside methods... > > > > function xxx(){ > > const yyy:Number=99 > > } > > > > What is the effect of that and what is the benefit? > > > > tks > > >