views:

42

answers:

1

Hi

I know that in C# when you pass an object (non primitive) to a method the following is true:

  1. A reference to the object is passed
  2. Changes made to the object in the method are reflected outside of the method.

Also, you can pass a reference to a reference in C# e.g this.changeObject(ref myObject);, in which case:

  • Changes to the object and also to the ref are reflected outside of the method e.g. myObject = new new List(); would change the passed objects referred location.

My question:

Is this possible to do in Flex/Actionscript - can a ref keyword be used?

+3  A: 

No, you cannot. ActionScript doesn't have a ref keyword or a similar (double pointer like) concept. You always pass object references to functions (except for primitives) and modifications are reflected back.

Amarghosh
Yeah, I looked at the documentation again, and could find nothing. Thanks for the reply
Brian Bishop