dmschenk,
[quoted text, click to view] > Thanks Dave
Sure thing.
[quoted text, click to view] > I played with the code you sent me and tweaked it a little
> bit and ended up with this:
>
> var vol:Number = 50;
Okay.
[quoted text, click to view] > this.onEnterFrame = function():Void {
> if (vol > 1) {
> vol -= 1;
> audio.setVolume(vol);
> } else {
> audio.setVolume(0);
> delete this.onEnterFrame;
> }
> }
Sure, that makes sense. :)
[quoted text, click to view] > I ended up setting the vol to 50 because that is where the
> volume is in the movie. I tried using the getVolume(); to
> detemine the volume but that didn't seem to work.
It sure should. But I wonder if you simply invoked getVolume() on its
own, as if it were a function? Here's the thing about objects ... objects
are defined by something called classes. Classes determine a given object's
properties (characteristics), things it can do (methods), and things it can
react to (events). The Sound class sets apart sound objects from, say,
movie clip objects, because the Sound class defines different properties,
methods, and events from the MovieClip class.
By the time you're dealing with a given object, you have to invoke a
method *on* that object instance. e.g.
var vol:Number = audio.getVolume();
.... assuming, by that point, that audio is already a valid Sound instance.
Of course, maybe you already know all this, so I apologize if I'm
telling you thinks you already know. You should be able to trace() any
property or method at any time to kinda see what you're dealing with ...
trace(audio.getVolume());
.... which helps you see "under the hood," a bit.
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/ "Luck is the residue of good design."