# Update targetpath with variable after onRelease

**URL:** <https://forum.kirupa.com/t/update-targetpath-with-variable-after-onrelease/303703>\
**Category:** flash\
**Created:** [January 25, 2010, 2:43pm UTC](https://forum.kirupa.com/t/update-targetpath-with-variable-after-onrelease/303703 "2010-01-25T14:43:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krachtstroom](https://avatars.discourse-cdn.com/v4/letter/k/d2c977/32.png) [@Krachtstroom](https://forum.kirupa.com/u/Krachtstroom)\
**Post date:** [January 25, 2010, 2:43pm UTC](https://forum.kirupa.com/t/update-targetpath-with-variable-after-onrelease/303703/1 "2010-01-25T14:43:43Z")

</div>

Hi guys,

I have the following script:

set (“positieMC”, “homeMC”);

\_level0.contentMC[positieMC].homeBTN.onRelease = function() {  
gotohome();  
set (“positieMC”, “homeMC”);  
};  
\_level0.contentMC[positieMC].fashionBTN.onRelease = function() {  
gotofashion();  
set (“positieMC”, “fashionMC”);  
};  
\_level0.contentMC[positieMC].wijBTN.onRelease = function() {  
gotowij();  
set (“positieMC”, “wijMC”);  
};  
\_level0.contentMC[positieMC].overheidBTN.onRelease = function() {  
gotooverheid();  
set (“positieMC”, “overheidMC”);  
};  
\_level0.contentMC[positieMC].btocBTN.onRelease = function() {  
gotobtoc();  
set (“positieMC”, “btocMC”);  
};  
\_level0.contentMC[positieMC].btobBTN.onRelease = function() {  
gotobtob();  
set (“positieMC”, “btobMC”);  
};  
\_level0.contentMC[positieMC].commercialsBTN.onRelease = function() {  
gotocommercials();  
set (“positieMC”, “commercialsMC”);  
};  
\_level0.contentMC[positieMC].diversenBTN.onRelease = function() {  
gotodiversen();  
set (“positieMC”, “diversenMC”);  
};

and I want these targetpath rewritten with the new variable of positieMC everytime I click the button. But somehow this doesn’t work. I have the idea that theze targetpath are not rewritten when I click the button.

Does anyone has an idea?

Thanks!
