# Passing Values To a Function

**URL:** <https://forum.kirupa.com/t/passing-values-to-a-function/79268>\
**Category:** flash\
**Created:** [February 12, 2005, 8:34am UTC](https://forum.kirupa.com/t/passing-values-to-a-function/79268 "2005-02-12T08:34:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnLBW](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@JohnLBW](https://forum.kirupa.com/u/JohnLBW)\
**Post date:** [February 12, 2005, 8:34am UTC](https://forum.kirupa.com/t/passing-values-to-a-function/79268/1 "2005-02-12T08:34:13Z")

</div>

[font=Verdana][size=2]Ok I have a gallery… All the images and the Title of each pic is in a DB, I get the data through xml and create an array object to hold all the image info , eg Title, Filename, Width, Height etc…[/size][/font]

I have an onRollOver Function (Thanks Kirupa) that produces hover text

each image in the gallery is added to the mc in a loop,

eg _image=myMC.createEmptyMovieClip(“img”+i…_ etc

and I set the onRollOver Function as shown here…

[font=Verdana][size=2]_image.Box.onRollOver = function() {_  
_\_root.x = 1;_

_\_root.HT.txt.text = array[counter].strTitle;_

_this.fader.\_alpha = 100;_

_};_

[/size][/font][font=Verdana][size=2]How Do I pass the value of array[counter].strTitle into the function… [/size][/font]  
[font=Verdana][size=2][/size][/font]  
NB… image.Box is another MC that creates a little fade effect over the image…  
[font=Verdana][size=2]I hope I have explained this properly.[/size][/font]  
[font=Verdana][size=2][/size][/font]  
[font=Verdana][size=2]thanks guys[/size][/font]  
[font=Verdana][size=2][/size][/font]  
[font=Verdana][size=2]John  
[/size][/font]
