# Can constants be compiled inline?

**URL:** <https://forum.kirupa.com/t/can-constants-be-compiled-inline/325445>\
**Category:** flash\
**Created:** [October 16, 2011, 11:02am UTC](https://forum.kirupa.com/t/can-constants-be-compiled-inline/325445 "2011-10-16T11:02:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeldalink](https://avatars.discourse-cdn.com/v4/letter/z/94ad74/32.png) [@zeldalink](https://forum.kirupa.com/u/zeldalink)\
**Post date:** [October 16, 2011, 11:02am UTC](https://forum.kirupa.com/t/can-constants-be-compiled-inline/325445/1 "2011-10-16T11:02:43Z")

</div>

I’ve been using ‘const’ for years, but I just found out that it is executed like a normal variable at runtime. Typically constants are supposed to be ‘inlined’…

… so when you write this:

```auto
const SPEED:int = 5;
o.x += SPEED;

```

…you should get this in the SWF:

```auto
o.x += 5;

```

…but when I decompile my SWF I get this:

```auto
const SPEED:int = 5;
o.x += SPEED;

```

Is there a way to force the Flex compiler to \*\*inline constants \*\*in AS3?
