# EventInstance::setParameterValue not working.

**URL:** https://qa.fmod.com/t/eventinstance-setparametervalue-not-working/13111
**Category:** FMOD Engine
**Created:** [April 17, 2017, 8:52am UTC](https://qa.fmod.com/t/eventinstance-setparametervalue-not-working/13111 "2017-04-17T08:52:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rtfc001](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@rtfc001](https://qa.fmod.com/u/rtfc001)
#### Post date: [April 17, 2017, 8:52am UTC](https://qa.fmod.com/t/eventinstance-setparametervalue-not-working/13111/1 "2017-04-17T08:52:26Z")

</div>

I hava Created an event in Fmod Studio like this:  
1)prepare three music  
2)there are three audio track,and three music has been added into track  
3)add marker, tempo makrer,transition region for each track.  
4)add a parameter named “demo” ,set it’s min value to 0,and max value to 30.  
5)click the first and the second transition region and add a condition param which value is 0 up to 1,1.1 up to 2  
6)prepare an application,put three buttons on it .the button one is used for starting play music. button two and button three are used for switching music.

In fmod studio,when i chang the “demo” param value,then the timeline cursor jump to the marker pointed by transition region immediately,and the music swiched gapless.

But in my code,there is no effective after i setted the parameter “demo” value in button click event function.my code like this:

```
void CFmodDemoDlg::OnBnClickedBtnFirst()
{
demoEventInstance->start();
studioSystem->update();
}

void CFmodDemoDlg::OnBnClickedBtnSecond()
{
FMOD_RESULT result;
result = demoEventInstance->setParameterValue("transcate", 0.5);
studioSystem->update();
result=demoEventInstance->triggerCue();
}

void CFmodDemoDlg::OnBnClickedBtnThird()
{
FMOD_RESULT result;
result=demoEventInstance->setParameterValue("transcate", 1.5);
studioSystem->update();
result=demoEventInstance->triggerCue();
}

```

it seems that only button three can play music after click it.

So,is there someone can help me ?  
thousands of thanks.

---

<div class="post-metadata">

### Author: ![rtfc001](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@rtfc001](https://qa.fmod.com/u/rtfc001)
#### Post date: [April 17, 2017, 9:20am UTC](https://qa.fmod.com/t/eventinstance-setparametervalue-not-working/13111/2 "2017-04-17T09:20:51Z")

</div>

> [@](#):
>
> I hava Created an event in Fmod Studio like this:  
> 1)prepare three music  
> 2)there are three audio track,and three music has been added into track  
> 3)add marker, tempo makrer,transition region for each track.  
> 4)add a parameter named “demo” ,set it’s min value to 0,and max value to 30.  
> 5)click the first and the second transition region and add a condition param which value is 0 up to 1,1.1 up to 2  
> 6)prepare an application,put three buttons on it .the button one is used for starting play music. button two and button three are used for switching music.
> 
> In fmod studio,when i chang the “demo” param value,then the timeline cursor jump to the marker pointed by transition region immediately,and the music swiched gapless.
> 
> But in my code,there is no effective after i setted the parameter “demo” value in button click event function.my code like this:
> 
> ```
> void CFmodDemoDlg::OnBnClickedBtnFirst()
> {
> demoEventInstance->start();
> studioSystem->update();
> }
> 
> void CFmodDemoDlg::OnBnClickedBtnSecond()
> {
> FMOD_RESULT result;
> result = demoEventInstance->setParameterValue("transcate", 0.5);
> studioSystem->update();
> result=demoEventInstance->triggerCue();
> }
> 
> void CFmodDemoDlg::OnBnClickedBtnThird()
> {
> FMOD_RESULT result;
> result=demoEventInstance->setParameterValue("transcate", 1.5);
> studioSystem->update();
> result=demoEventInstance->triggerCue();
> }
> 
> ```
> 
> it seems that only button three can play music after click it.
> 
> So,is there someone can help me ?  
> thousands of thanks.

It’s working,but i still don’t understand what happens
