learning through interaction
Until now I didn't have any issue when removing an item from the display list until the item had sound in it. This has to do with an application I am working on which loads several SWFs and they have to be turned "on" and "off". When the SWF has to be turned off the sound has to go with it. So having the item be removed from the DisplayList was the first "answer", but of course if every listener has to be removed from any item that is being removed from the DisplayList the sound object is not an exception. But how do you do that? Again the first logic was to add a new Sound object to the loaded SWF and then control the sound in that way but that didn't fly. Looking in the docs with more detail we find the SoundTransform and here is a description "The SoundTransform class contains properties for volume and panning. The following objects contain a soundTransform property, the value of which is a SoundTransform object: Microphone, NetStream, SimpleButton, SoundChannel, SoundMixer, and Sprite"
So with that knowledge in mind now we can control the sound of the loaded SWF's and here is a sample of what I was working with.
One thing that you will notice is that I muted two movies at once by adding two movies into one item and then controlling the volume of that single item. The reason why am I doing it this way is because I need control of one movie at the time as also control of all movies together.
Another thing you will notice is a Timer Event, that was just added to enhance my testing but doesn't have to be used in this way.
Main entry continued
During the day I work as a Sr. Rich Media Designer for T3, During the evenings I enjoy the best time of the day as a husband and a father and sometimes during the nights I work for myself at multimedia247.
This blog is mostly about my findings on the web, my contribution to noobs to flash that might be able to learn something from the site. If you dont consider yourself a noob and you still were able to learn or discover something new on this blog, even better.
Leave a reply