# SoundTransform

**URL:** <https://forum.kirupa.com/t/soundtransform/268625>\
**Category:** flash\
**Created:** [August 16, 2008, 3:02am UTC](https://forum.kirupa.com/t/soundtransform/268625 "2008-08-16T03:02:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenBart](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@BenBart](https://forum.kirupa.com/u/BenBart)\
**Post date:** [August 16, 2008, 3:02am UTC](https://forum.kirupa.com/t/soundtransform/268625/1 "2008-08-16T03:02:20Z")

</div>

[http://www.helmutgranda.com/2008/02/11/stop-sound-of-loaded-swfs-in-as3/](http://www.helmutgranda.com/2008/02/11/stop-sound-of-loaded-swfs-in-as3/)

I found this code through google search. I tried adapting it to my current code and I’m having trouble. Is it because this essentially creates a new class?

Here is my code without the mute option:

```auto
 import flash.media.SoundTransform;
 import flash.display.Loader;

var imageLoader:Loader;

function loadImage(url:String):void {
    // Show Preloader
    preloader.visible = true;
    
    // Set properties on my Loader object
    imageLoader = new Loader();
    imageLoader.load(new URLRequest(url));
    imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
    imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
}
loadImage("swfs/pul.swf");

function imageLoaded(e:Event):void {
    // Load Image
    
    imageLoadArea.addChild(imageLoader);
    imageLoader.name = "pulmi";
    imageLoader.width = 320;
    imageLoader.height = 280;
    // Hide Preloader
    preloader.visible = false;

}

function imageLoading(e:ProgressEvent):void {
    // Get current download progress
    var loaded:Number = e.bytesLoaded / e.bytesTotal;
    
    // Send progress info to "preloader" movie clip
    preloader.SetProgress(loaded);
}

```

I would think that I could just create a new SoundTransform and then apply it to my movieClip

```auto
function imageLoaded(e:Event):void {
    // Load Image
    
    imageLoadArea.addChild(imageLoader);
    imageLoader.name = "pulmi";
    imageLoader.width = 320;
    imageLoader.height = 280;
    // Hide Preloader
    preloader.visible = false;
    var mySoundTransform = new SoundTransform();
     mySoundTransform.volume = 0; 
     imageLoader.soundTransform = mySoundTransform;

}

```

But I get this error:  
1119: Access of possibly undefined property soundTransform through a reference with static type flash.display:Loader.
