# Creating a function- what am i doing wrong?

**URL:** https://forum.kirupa.com/t/creating-a-function-what-am-i-doing-wrong/77320
**Category:** flash
**Created:** [January 26, 2005, 12:19pm UTC](https://forum.kirupa.com/t/creating-a-function-what-am-i-doing-wrong/77320 "2005-01-26T12:19:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![stunt\_penguin](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@stunt\_penguin](https://forum.kirupa.com/u/stunt_penguin)
#### Post date: [January 26, 2005, 12:19pm UTC](https://forum.kirupa.com/t/creating-a-function-what-am-i-doing-wrong/77320/1 "2005-01-26T12:19:41Z")

</div>

Hi,

i’ve been working on a script that will dyanamically scale some background images, I can’t see what’s wrong with this function:  
[font=Courier New][size=2]  
//the ‘adjustSliders’ function is called by the actionscript in the actions layer in \_root. it is used to move the masks of the moving background images  
// desired\_x and desired\_xscale are called on in each slider movieclip  
adjustSliders = function (1x:String,1scale:String,2x:String,2scale:String,3x:String,3scale:String,4x:String,4scale:String,5x:String,5scale:String,6x:String,6scale:String.){

```
    _root.slidingImages_mc.section1_mc.desired_x = 1x;
    _root.slidingImages_mc.section1_mc.desired_xscale = 1scale;
    
    _root.slidingImages_mc.section2_mc.desired_x = 2x;
    _root.slidingImages_mc.section2_mc.desired_xscale = 2scale;
    
    _root.slidingImages_mc.section3_mc.desired_x = 3x;
    _root.slidingImages_mc.section3_mc.desired_xscale = 3scale;
    
    _root.slidingImages_mc.section4_mc.desired_x = 4x;
    _root.slidingImages_mc.section4_mc.desired_xscale = 4scale;
    
    _root.slidingImages_mc.section5_mc.desired_x = 5x;
    _root.slidingImages_mc.section5_mc.desired_xscale = 5scale;
    
    _root.slidingImages_mc.section6_mc.desired_x = 6x;
    _root.slidingImages_mc.section6_mc.desired_xscale = 6scale;

```

}  
[font=Verdana][size=3]  
[/size][/font][font=Verdana][size=3]I get 13 AS errors- one for each of the lines in the function :o/

\*sorry if the first few lines are broken  
[/size][/font] [/size][/font]
