# \[AS2\] Help me! variables went crazy!

**URL:** <https://forum.kirupa.com/t/as2-help-me-variables-went-crazy/284281>\
**Category:** Uncategorized\
**Created:** [March 17, 2009, 3:29pm UTC](https://forum.kirupa.com/t/as2-help-me-variables-went-crazy/284281 "2009-03-17T15:29:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mentega](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@mentega](https://forum.kirupa.com/u/mentega)\
**Post date:** [March 17, 2009, 3:29pm UTC](https://forum.kirupa.com/t/as2-help-me-variables-went-crazy/284281/1 "2009-03-17T15:29:12Z")

</div>

hi, i have a funny error with variables that instead of adding values from 2 variable it combines them, altough both has been declared as Number, these vars should be all numbers because im going to use them to locate the center of a image loaded to mc via loadClip, i tested with simple boxes the script works but here it becomes weird

tried parseInt() with no result, are there any way to fix this?

for the codes on the top i declared

```auto
var full_x:Number
var full_y:Number
var defaultWidth:Number
var defaultHeight:Number

```

then when the fulllx and y has been filled, i use those var to calculate this

```auto
var xCenter:Number = Math.floor(((defaultWidth - target._width) / 2) )
var yCenter:Number = Math.floor(((defaultHeight - target._height) / 2))

finalX = Math.floor(xCenter + full_x)
finalY = Math.floor(yCenter + full_y)

```

so the traces return full\_x = 350 and full\_y = 35  
and the xCenter returns = 1 the yCenter returns = 114

however the finalX and Y each returns – 1350 and 11435, so somehow flash thought my vars are strings and combine them instead of adding values…
