# AS3 Assignment Operators

**URL:** <https://forum.kirupa.com/t/as3-assignment-operators/316490>\
**Category:** flash\
**Created:** [November 23, 2010, 11:47am UTC](https://forum.kirupa.com/t/as3-assignment-operators/316490 "2010-11-23T11:47:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![slideth3](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@slideth3](https://forum.kirupa.com/u/slideth3)\
**Post date:** [November 23, 2010, 11:47am UTC](https://forum.kirupa.com/t/as3-assignment-operators/316490/1 "2010-11-23T11:47:14Z")

</div>

I am currently trying to write an RGB class, and I was wondering if actionscript supported assignment operators (and other operators i.e +,-,\*,/);

If for example I have two colors:

var c1:RGB = new RGB(255,0,0);  
&  
var c2:RGB = new RGB(0,255,0);

I was wondering if it was possible to do something like

trace(c1+c2) // {R:255,G:255,B:0}

c1 += c2;  
trace(c1) // {R:255,G:255,B:0}.

I have done this in C++ in the past using ::/=, or ::+= as an operator, and was just wondering if this was possible in flash using override operator or something?

Thanks in advance for any help!

Sam Halliday
