Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing reference types by ref - Flex/Actionscript

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?

like image 244
Drenai Avatar asked Jun 10 '26 10:06

Drenai


1 Answers

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.

like image 157
Amarghosh Avatar answered Jun 13 '26 05:06

Amarghosh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!