# Not being able to access variables in function

**URL:** <https://forum.kirupa.com/t/not-being-able-to-access-variables-in-function/267986>\
**Category:** Uncategorized\
**Created:** [August 7, 2008, 8:41pm UTC](https://forum.kirupa.com/t/not-being-able-to-access-variables-in-function/267986 "2008-08-07T20:41:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![geestring](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@geestring](https://forum.kirupa.com/u/geestring)\
**Post date:** [August 7, 2008, 8:41pm UTC](https://forum.kirupa.com/t/not-being-able-to-access-variables-in-function/267986/1 "2008-08-07T20:41:39Z")

</div>

I have arrays and variables in a loop in function loadXML()

now in this function I have a link.addEventListener(MouseEvent.CLICK, clicked);

now in clicked I want to access variables that are in loadXML()  
How do I do this? Do I need to pass arguements in the listener?  
In AS2 I would just make them \_global.
