# Using a function to set x position

**URL:** <https://forum.kirupa.com/t/using-a-function-to-set-x-position/282990>\
**Category:** flash\
**Created:** [March 1, 2009, 2:54am UTC](https://forum.kirupa.com/t/using-a-function-to-set-x-position/282990 "2009-03-01T02:54:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marilynn\_fowler](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@marilynn\_fowler](https://forum.kirupa.com/u/marilynn_fowler)\
**Post date:** [March 1, 2009, 2:54am UTC](https://forum.kirupa.com/t/using-a-function-to-set-x-position/282990/1 "2009-03-01T02:54:21Z")

</div>

I’ve declared a global variable called [COLOR=DarkRed]thumbSpace[/COLOR].  
I have an [COLOR=DarkRed]xmlLoaded[/COLOR] function that loads in thumbnails from an xml file using a loop.  
I have an event listener call the [COLOR=DarkRed]thumbLoaded[/COLOR] function when the thumbnail is done loading.

The [COLOR=DarkRed]thumbLoaded[/COLOR] function returns the width of each thumbnail.

```auto
function thumbLoaded(event:Event):Number {
    return event.target.width;
}

```

Inside of the [COLOR=DarkRed]xmlLoaded[/COLOR] function I have the following lines of code:

```auto
thumbSpace += thumbLoaded();

```

I keep getting the "error message 1136: Incorrect number of arguments. Expected 1."�

What am I doing wrong?? I’m trying to use the [COLOR=DarkRed]thumbLoaded[/COLOR] function to set the X position of my thumbnails.
