# Dictionary for Video

**URL:** <https://discourse.processing.org/t/dictionary-for-video/8483>\
**Category:** Libraries\
**Created:** [February 17, 2019, 2:51pm UTC](https://discourse.processing.org/t/dictionary-for-video/8483 "2019-02-17T14:51:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alterus](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@alterus](https://discourse.processing.org/u/alterus)\
**Post date:** [February 17, 2019, 2:51pm UTC](https://discourse.processing.org/t/dictionary-for-video/8483/1 "2019-02-17T14:51:44Z")

</div>

I am just recently getting into Processing after using Supercollider for a while. Now I am looking for code that plays another random video from a map on my computer every time it is cue’d. Similar to what is possible with the dictionary function in Supercollider.  
Can anyone point me in the right direction for this? 🙂

---

<div class="post-metadata">

**Author:** ![wqt](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/wqt/32/3546_2.png) [@wqt](https://discourse.processing.org/u/wqt)\
**Post date:** [February 18, 2019, 10:00am UTC](https://discourse.processing.org/t/dictionary-for-video/8483/2 "2019-02-18T10:00:12Z")

</div>

Hi, I am not sure I understand your question since I have never used Supercollider, but there are dictionary data types in Processing [https://www.processing.org/reference/StringDict.html](https://www.processing.org/reference/StringDict.html). You could also use an ArrayList to store Movie objects (aka the videos), and access them by selecting a random index. [https://www.processing.org/reference/ArrayList.html](https://www.processing.org/reference/ArrayList.html)

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [February 20, 2019, 10:57pm UTC](https://discourse.processing.org/t/dictionary-for-video/8483/3 "2019-02-20T22:57:34Z")

</div>

> [@alterus](#):
>
> from a map on my computer

Can you say more about what you mean by ‘map’? Do you mean, a directory of video files, or a text file that lists video files, or…?

Begin with the Processing \> Examples \> Libraries \> Video \> Movie \> Loop example.

Instead of just providing the movie file name as a string (“transit.mov”), load a list of movie file names from a file with loadStrings:

> **[loadStrings() / Reference](https://processing.org/reference/loadStrings_.html)**
>
> Reads the contents of a file and creates a String array of its individual lines. If the name of the file is used as the parameter, as in the above example, the file must be loaded in the sketch's "dat…

…and then choose a random element from that list to be your movie file name.
