ripnoel
asked on
Losing volume control when loading swf into another movie.
I have built a swf movie for video playback and volume control which works fine when played alone. When I load this external SWF file into another movie I am loosing my volume control. here is the code I'm using for volume control:
-------------------------
var s:Sound = new Sound();
s.setVolume(100);
mc_soundLevel.mc_bar._ysca le = 100;
mc_soundLevel.onPress = function() {
volumeTo = (this._ymouse / this._height)*100;
this.mc_bar._yscale = -volumeTo;
s.setVolume(volumeTo);
}
-------------------------- --
Ideas/help appreciated
Rip
-------------------------
var s:Sound = new Sound();
s.setVolume(100);
mc_soundLevel.mc_bar._ysca
mc_soundLevel.onPress = function() {
volumeTo = (this._ymouse / this._height)*100;
this.mc_bar._yscale = -volumeTo;
s.setVolume(volumeTo);
}
--------------------------
Ideas/help appreciated
Rip
ASKER
Does nothing no matter where I place it...other ideas?
volumeTo: Number = (this._ymouse / this._height)*100;
Z
Z
ASKER
I'm really not sure what you are suggesting...have you looked at my original code? The issue I'm trying to address is NOT trying to get it to work BUT to get it to work when imported into another flash movie. Works fine stand alone.
My code:
------------------------
var s:Sound = new Sound();
s.setVolume(100);
mc_soundLevel.mc_bar._ysca le = 100;
mc_soundLevel.onPress = function() {
volumeTo = (this._ymouse / this._height)*100;
this.mc_bar._yscale = -volumeTo;
s.setVolume(volumeTo);
}
My code:
------------------------
var s:Sound = new Sound();
s.setVolume(100);
mc_soundLevel.mc_bar._ysca
mc_soundLevel.onPress = function() {
volumeTo = (this._ymouse / this._height)*100;
this.mc_bar._yscale = -volumeTo;
s.setVolume(volumeTo);
}
Yes looked at your code..It just that it's a mix of AS1 and AS2 and if you are importing it into a swf exported as AS2 the imported clip may fall over as the parent clip's attributes are inherited by the imported clip..frame-rate etc.
anyway..try the following with reference to the clip rather than default reference to _root (which is why I suggested _lockroot in the clip)..
var s:Sound = new Sound();
s.setVolume(100);
this.mc_soundLevel.mc_bar. _yscale = 100;
this.mc_soundLevel.onPress = function() {
var volumeTo:Number = (this._ymouse / this._height)*100;
this.mc_bar._yscale = -volumeTo;
s.setVolume(volumeTo);
}
Z
anyway..try the following with reference to the clip rather than default reference to _root (which is why I suggested _lockroot in the clip)..
var s:Sound = new Sound();
s.setVolume(100);
this.mc_soundLevel.mc_bar.
this.mc_soundLevel.onPress
var volumeTo:Number = (this._ymouse / this._height)*100;
this.mc_bar._yscale = -volumeTo;
s.setVolume(volumeTo);
}
Z
ASKER
Already tried this and tried it again to no avail. I feel I need to put a volume controller on the main movie timeline (and just below my video) where I have a music player there already. Can you provide some proper code I can add in to this area as an overall volume controller?
Thanks,
Rip
Thanks,
Rip
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
this._lockroot = true;
Z