Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Volume slider not working within movie clip

Status
Not open for further replies.

tallgiant

Technical User
Aug 4, 2004
10
US
I successfully created a volume slider in the main scene of my movie, but when I do a volume slider in an embeded movie clip, the slider button appears off the screen at 0 on the x axis. Any ideas how I can fix this within the movie clip? The code is below. Thanks in advance for the help.

onClipEvent(load) {
this._x=_root.hbase._x + _root.hbase._width/2 - this._width/2;
left=this._x - _root.hbase._width/2;
top=this._y;
right=this._x + _root.hbase._width/2;
bottom=this._y;
volCalc=_root.hslider._x - _root.hbase._width/2

//
//End of load
}
//
onClipEvent(mouseDown) {
startDrag(this, false, left , top , right, bottom)
}
//
onClipEvent(mouseUp) {
this.stopDrag();
}
//
onClipEvent(enterFrame) {

// This constantly sets the current a-axis position of
//the slider to "sliderx
sliderx=_root.hslider._x; //Sets sliderx as variable for a-axis of slider
myMusicVolume=(sliderx-volCalc); //The value of x-axis load value - n = 50
_root.myMusic.setVolume(myMusicVolume);
_root.currentVolume="Volume " + _root.myMusic.getVolume();
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top