---
title: "soundHolder();"
type: "forum-thread"
url: "https://www.webforum.nu/amne/flash/149193-soundholder"
topic: "Flash"
topic_url: "https://www.webforum.nu/amne/flash"
author: "xhlin"
published: "2006-07-18T18:52:08.000Z"
updated: "2006-07-19T15:57:41.000Z"
replies: 2
views: 274
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/flash/149193-soundholder"
---

# soundHolder();

## #1 — xhlin, 2006-07-18T18:52Z

jag undrar om det går att tex ställa separat volym till ett mC som håller på två ljud?

```
this.createEmptyMovieClip("holder", this._root.getNextHighestDepth());
this.createEmptyMovieClip("h1", this.getNextHighestDepth());
this.createEmptyMovieClip("h2", this.getNextHighestDepth());

this.holder.attachMovie("h1","h1", this.getNextHighestDepth());
this.holder.attachMovie("h2","h2", this.getNextHighestDepth());

holder.h1=new Sound(fx1);
holder.h1.attachSound("fx1");
holder.h2=new Sound(fx2);
holder.h2.attachSound("fx2");

holder.h1.setPan(-100);
holder.h2.setPan(100);
```

just nu kan man inte styra ett enskilt ljud, jag antar att det har med deras depth, om det nu går ?

hjälp!

Permalänk: https://www.webforum.nu/p/149193

## #2 — mirandir, 2006-07-19T13:51Z

Det funkar inte eftersom du har inte kopplat ljudobjekten till något individuellt filmklipp. Däremot så skrivs filmklippens instansnamn över. 

Testa såhär istället:

```
this.createEmptyMovieClip("holder", this._root.getNextHighestDepth());
this.createEmptyMovieClip("h1", this.getNextHighestDepth());
this.createEmptyMovieClip("h2", this.getNextHighestDepth());

this.holder.attachMovie("h1","h1", this.getNextHighestDepth());
this.holder.attachMovie("h2","h2", this.getNextHighestDepth());

[b]fx1 = new Sound(holder.h1);
fx1.attachSound("fx1");
fx2 = new Sound(holder.h2);
fx2.attachSound("fx2");[/b]

fx1.setPan(-100);
fx2.setPan(100); 

// Nu skall du kunna styra volymerna individuellt:
fx1.setVolume(50);
fx2.setVolume(70);
```

/Mirandir

Permalänk: https://www.webforum.nu/p/1843261

## #3 — xhlin, 2006-07-19T15:57Z

det gör tyvärr ingen skillnad ;(
vad man än gör påverkar man alla ljud...

hjälp!

Permalänk: https://www.webforum.nu/p/1843288

---

Tråden på webben: https://www.webforum.nu/amne/flash/149193-soundholder
