# If i want to create Event by using javascript, how can i create 3D event on action sheet?

**URL:** <https://qa.fmod.com/t/if-i-want-to-create-event-by-using-javascript-how-can-i-create-3d-event-on-action-sheet/20627>\
**Category:** FMOD Studio\
**Tags:** javascript\
**Created:** [September 7, 2023, 11:45am UTC](https://qa.fmod.com/t/if-i-want-to-create-event-by-using-javascript-how-can-i-create-3d-event-on-action-sheet/20627 "2023-09-07T11:45:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenken0615](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kenken0615](https://qa.fmod.com/u/Kenken0615)\
**Post date:** [September 7, 2023, 11:45am UTC](https://qa.fmod.com/t/if-i-want-to-create-event-by-using-javascript-how-can-i-create-3d-event-on-action-sheet/20627/1 "2023-09-07T11:45:07Z")

</div>

What’s more, i want to select this event after create this event.  
i wrote code like this:

```auto
var m_event = studio.project.create("Event")
m_event.name = "Test event";
var actionSheet = studio.project.create("ActionSheet");
m_event.relationships.parameters.add(actionSheet);

```

1. I have no idea on how to add sound on this action sheet
2. I want to make this event as 3d event
3. I want to select this event after it is created.  
Thank you so much!

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [September 8, 2023, 5:52am UTC](https://qa.fmod.com/t/if-i-want-to-create-event-by-using-javascript-how-can-i-create-3d-event-on-action-sheet/20627/2 "2023-09-08T05:52:58Z")

</div>

Hi,

> [@Kenken0615](#):
>
> I have no idea on how to add sound on this action sheet

With the existing var `actionSheet` in your code, you can do the following:

```auto
var sound = studio.project.create('SingleSound');
sound.owner = actionSheet.modules;

```

> [@Kenken0615](#):
>
> I want to make this event as 3d event

`m_event.mixer.masterBus.effectChain.addEffect('SpatialiserEffect')` will add an FMOD Spatializer to the event’s master track, thereby making it a 3D event.

> [@Kenken0615](#):
>
> I want to select this event after it is created.

`studio.window.navigateTo(event)` will navigate the the event and highlight it in the Event Editor.

---

<div class="post-metadata">

**Author:** ![Kenken0615](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kenken0615](https://qa.fmod.com/u/Kenken0615)\
**Post date:** [September 8, 2023, 9:05am UTC](https://qa.fmod.com/t/if-i-want-to-create-event-by-using-javascript-how-can-i-create-3d-event-on-action-sheet/20627/3 "2023-09-08T09:05:18Z")

</div>

That would be Great help!  
Thank you so much!  
One more~~  
Is it possibile to check an event is selected or not? any properties?  
Because i want to write a filter script which can help to select event.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [September 11, 2023, 10:45pm UTC](https://qa.fmod.com/t/if-i-want-to-create-event-by-using-javascript-how-can-i-create-3d-event-on-action-sheet/20627/4 "2023-09-11T22:45:02Z")

</div>

> [@Kenken0615](#):
>
> Is it possibile to check an event is selected or not? any properties?

Can you elaborate on what exactly you mean? For example, are you trying to check whether the event currently selected in the Event Editor is the same event as another you have assigned to a variable? Or do you mean something else?

---

<div class="post-metadata">

**Author:** ![Kenken0615](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kenken0615](https://qa.fmod.com/u/Kenken0615)\
**Post date:** [September 12, 2023, 3:05am UTC](https://qa.fmod.com/t/if-i-want-to-create-event-by-using-javascript-how-can-i-create-3d-event-on-action-sheet/20627/5 "2023-09-12T03:05:34Z")

</div>

Sorry for unclear.  
I just want to give an input text line to the users, they can write some text such as “NPC”, and then all events’ name contain “NPC” string will be highlight or selected in the Event Editor.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [September 13, 2023, 12:10am UTC](https://qa.fmod.com/t/if-i-want-to-create-event-by-using-javascript-how-can-i-create-3d-event-on-action-sheet/20627/6 "2023-09-13T00:10:23Z")

</div>

> [@Kenken0615](#):
>
> I just want to give an input text line to the users, they can write some text such as “NPC”, and then all events’ name contain “NPC” string will be highlight or selected in the Event Editor.

I’m not sure whether it’s exactly what you’re looking for, but `studio.window.browserSelection()` will return an array of the objects currently selected in the active window. The best way to compare a selected event to some other event is to compare their globally unique IDs, which you can do with `event1.id === event2.id`.

---

<div class="post-metadata">

**Author:** ![Kenken0615](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kenken0615](https://qa.fmod.com/u/Kenken0615)\
**Post date:** [September 13, 2023, 3:25am UTC](https://qa.fmod.com/t/if-i-want-to-create-event-by-using-javascript-how-can-i-create-3d-event-on-action-sheet/20627/7 "2023-09-13T03:25:04Z")

</div>

All Right, i think i know what to do, thank you so much!
