# Passing varibles into a function

**URL:** <https://forum.kirupa.com/t/passing-varibles-into-a-function/297978>\
**Category:** Uncategorized\
**Created:** [October 11, 2009, 6:36pm UTC](https://forum.kirupa.com/t/passing-varibles-into-a-function/297978 "2009-10-11T18:36:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gotlisch](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@gotlisch](https://forum.kirupa.com/u/gotlisch)\
**Post date:** [October 11, 2009, 6:36pm UTC](https://forum.kirupa.com/t/passing-varibles-into-a-function/297978/1 "2009-10-11T18:36:25Z")

</div>

Hi there, I’m trying to achive the following, but it doesn’t work…what am I doing wrong?

[COLOR=SeaGreen]\*myMovieClip.myButton.addEventListener(MouseEvent.CLICK, jumpToSection(‘contact’));

function jumpToSection(sectionName:String):void{  
myMovieClip.mySectionsMovieClip.gotoAndPlay(sectionName);  
}\*[/COLOR]

Seem like a logical approach to me but then again I’m not really a flash developer ☹

Cheers,  
Mikael
