Groups | Blog | Home
all groups > flash actionscript > july 2004 >

flash actionscript : Help with Volume Control


Rocky Caamano
7/7/2004 2:51:44 PM
It looks like you are writing the script in the wrong place. Try naming your
button and then changing your script to make it look like the one below.
This script should be written on the timeline,and not on the button itself.

myButton_btn.onPress = function(){
//your Press code here
}

myButton_btn.onRelease = function(){
//your Release code here
}


--
Rocky Caamano
[quoted text, click to view]

johnclin
7/7/2004 9:16:54 PM
I was trying to follow the HELP files from: C:\Program Files\Macromedia\Flash
MX 2004\en\First Run\HelpPanel\Help\ActionScriptReference\05_interaction12.html

to create a Volume Control. After repeated attemps, I can get the control to
work, but there's always an error when I compile as well. It stil works,
though the error is annoying. It says:
**Error** Symbol=Volume, layer=Layer 1, frame=1:Line 1: Mouse events are
permitted only for button instances
on (press) {

**Error** Symbol=Volume, layer=Layer 1, frame=1:Line 4: Mouse events are
permitted only for button instances
on (release) {

Total ActionScript Errors: 2 Reported Errors: 2


Any suggestions?
kglad
7/7/2004 9:56:36 PM
johnclin
7/7/2004 10:46:53 PM
Okay. So in my Volume Movie clip on frame 1 I have made this the code for the
Volume Button I named as myButton:

myButton_btn.onPress = function(){
startDrag(this, false, left, top, right, bottom);
}
myButton_btn.onRelease = function(){
stopDrag();
}

However, the error is gone, but my volume button doesn't drag now.
kglad
7/8/2004 2:11:27 AM
Kev P
7/8/2004 1:24:30 PM
i have recently built a very simple mp3 player which uses a slider bar to set
volume levels.

I will attach it if you want and you may find looking at the code easier to
understand than by me explaing it.
AddThis Social Bookmark Button