;

PDA

Click to See Complete Forum and Search --> : volume buttons


imladris
04-28-2005, 08:26 PM
Please help....
I am trying to create a volume control that will control the volume of my entire movie-regardless of what is playing. My control actually contains 10 little buttons rather than the typical slider.
I want each of the buttons to represent a different volume: ie button 1 will be the minimum and the last button will be max vol and then everything inbetween.
Being a complete novice i just cant get to grips with what actions i need to give each button to acheive this (i assume actionscript is used, although bear in mind that this is like Japeneese to me).

To see what i mean, please see my test site at www.martyn.guitarman.ukonline.co.uk


Thanks in advance

necromanthus
04-29-2005, 04:25 AM
Download and study this example:
http://necromanthus.com/KoolMoves/SoundTracks.html

p.s.
Nice work there.
Congrats !
:smoov:

tmoore935
04-29-2005, 02:03 PM
http://www.diversioncentral.com/mp3/t.html
http://www.diversioncentral.com/mp3/t.zip

This is my version. I like your site also. Please post again when you are finished.:D

imladris
04-29-2005, 03:29 PM
many thanks tmoore935 for those examples. i was slightly confused by necromanthus' reply (no offence intended) and after 4 days of going in circles, your reply has stopped me throwing my pc outta the nearest window.

cheers again, and i will letyou know how i am getting on with the site.

imladris

imladris
04-29-2005, 08:14 PM
thanks for your help again tmoore935. a quick question - using your example, what changes would i need to make to get the mp3 file to play automatically rather than use the "play" button, and also to stream rather than download.
thanks again for all your help

imladris


:D

tmoore935
04-29-2005, 09:26 PM
To see what I have:
http://www.diversioncentral.com/mp3/stream2.html


The fun file:
http://www.diversioncentral.com/mp3/stream2.fun

Let me know if it works for you.


This was from a couple of weeks ago. Looking at your own site which is pretty good, you should have no problem combinig the two fun fules for your needs.

imladris
05-03-2005, 09:46 AM
Thanks for that tmoore935, I will take a look at the files you provided and have a play - some nice bits on there that i hadn't thought of like displaying bytes loading/loaded and displying current volume. That will keep me busy for a while.
One quick question - what does 1024 refer to in loading and loaded lines of the action scripting (?) as the mp3 file you provided in the example was 842kb.

Thanks again (i'll mention you on the credits as i wouldn't be getting this far without some outside help)

imladris





:D

tmoore935
05-03-2005, 07:11 PM
Originally posted by imladris
[BOne quick question - what does 1024 refer to in loading and loaded lines of the action scripting (?) as the mp3 file you provided in the example was 842kb.

imladris


:D [/B]


If you remove the 1024 you would get 862208. If you divide that by 2^10 or 1024, you get KB which is easier I think to comprehend. It works frame by frame so it is not perfect but seems to work with koolmoves and gives some idea to the user of what is going on.

imladris
05-04-2005, 01:11 PM
Dear tmoore935

I can't thankyou you enough for all the help - my first test song is now uploaded at www.martyn.guitarman.ukonline.co.uk

I have one final problem (HONEST!!) that you may be able to help me with:

Level 0 contains the main interface which automatically loads the media base into level 2 (level 1 will be used for the information channels).

The media base is basically an amended version of the files you provided me with.

What I need to achieve is this:

Each of the songs listed will play automatically one after the other with the option of using the "previous" and "next" buttons to skip backwards and forwards.

Do you have any idea how I can amend the media base to achieve these two things?

ONCE AGAIN MANY THANKS & PLEASE FEEL FREE TO TELL ME TO GET LOST IF I'M BEING A PAIN IN THE BUTT

IMLADRIS

tmoore935
05-04-2005, 01:29 PM
Originally posted by imladris
Dear tmoore935

What I need to achieve is this:

Each of the songs listed will play automatically one after the other with the option of using the "previous" and "next" buttons to skip backwards and forwards.

IMLADRIS

I did this with my last web site. but I used flash mx. So give me a day or two to look it up and I will post the code that I used. But i remember that I used some method to determine when the song was at 99.9 percent(similar to a preloader) then I had used loadMovieNum to the same level as the first player. This was an If statement. But the songs were swf's. with mp3's it is easier.

tmoore935
05-04-2005, 08:05 PM
This is what I used on my last mp3 player which was in flash MX:

var total = Math.round(_level1.getBytesTotal()/1024);
var loaded = Math.round(_level1.getBytesLoaded()/1024);
_level1.percent = Math.round((_level1._currentframe/_level1._totalframes)/.01);

// to load the second song
if (_level1.percent>=99.9) {
loadMovieNum("player2.swf", 11);
stop();
stopAllSounds();
}

It actually loaded a new player but it did work very well.
Also go her and go to Fact #25 at:

http://www.flashkit.com/board/showthread.php?threadid=299918

tmoore935
05-04-2005, 11:48 PM
I came up with a simple way to run one song after another. Each song is only for a few seconds. There are three songs. (These could be placed inside of another movie so as to control the volume and keep it the same with all the songs). This is a simple demo with no graphics. player1.html is the only html page needed as the other two swf's will load inside of it. This works in IE and firefox. When i used this method before, I tested on several different computers and it seemed reliable. I am sure there are easier ways to do it.

http://www.diversioncentral.com/stream/player1.html

tmoore935
05-04-2005, 11:49 PM
Here are the zips:rolleyes:

imladris
05-05-2005, 06:21 AM
Dear tmoore935

My knowledge of actionscript is Zero, but i had a thought on an easier way which you may be able to help with (this all refers to the Demo001 zip i provided before).
I have changed it to 2 frames with a stopmovie function on frame 2. Then i have added more (blank for the moment) frames. If i created the bits and bobs needed for the next mp3 in frame 3 (as done previously) would i be able to add to the prevoius code (below) to tell the movie that on sound stopping goto frame 3. This would solve my problem and also make manual navigation very easy.

i know there are commands such as "onSoundComplete" , "gotoAndPlay" etc, but can't work out how to put them together.

Thanks

Imladris



onClipEvent (load) {
Sound = new Sound();
//to stream
Sound.LoadSound("MADMAN2.mp3", true);
Sound.start();


}

onClipEvent (enterFrame) {
_root.dl4=Sound.getBytesLoaded()/1024;
_root.dl5=Sound.getBytesTotal()/1024;

}
onClipEvent (enterFrame) {
Sound.setVolume(_root.volume);
Sound.setPan(_root.pan);

}

tmoore935
05-05-2005, 10:11 AM
on SoundComplete is something tyhat I learned just the other day from the sound forum. The following activates actionscript in order to load another player or you possibly could use it to load another song. This is what was in player1.swf:

onClipEvent (enterFrame) {
_root.dl4=Sound.getBytesLoaded()/1024;
_root.dl5=Sound.getBytesTotal()/1024;
//to load the next song
Sound.onSoundComplete = function() {loadMovieNum("player2.swf", 0);}


}

in psudo tems it is nothing more than:

Sound.onSoundComplete = function() {your actionscript goes here}

you could put a geturl or something else. I have not tried the gotoAnd Play but it is a sharp idea. That way only one player is needed. This might work. It would send the swf to frame 6. make sure the tweens are set at 0 and that there is no preloader.

Sound.onSoundComplete = function() {gotoAndPlay(6)};

this would give you:

onClipEvent (enterFrame) {
_root.dl4=Sound.getBytesLoaded()/1024;
_root.dl5=Sound.getBytesTotal()/1024;
//to load the next song
Sound.onSoundComplete = function() {gotoAndPlay(6)};

}

i am at work and I do not have time to see if this works. But try it out. I am no expert at actionscript but have read a lot on the different websites that are around.

imladris
05-05-2005, 12:24 PM
i've had a go and it doesn't appear to work.

my final script was:

onClipEvent (load) {
Sound = new Sound();
//to stream
Sound.LoadSound("MADMAN2.mp3", true);
Sound.start();


}

onClipEvent (enterFrame) {
_root.dl4=Sound.getBytesLoaded()/1024;
_root.dl5=Sound.getBytesTotal()/1024;
//to load the next song
Sound.onSoundComplete = function() {gotoAndPlay(3)};




}
onClipEvent (enterFrame) {
Sound.setVolume(_root.volume);
Sound.setPan(_root.pan);
}

ps-i'm at work too hehe.:(

tmoore935
05-05-2005, 01:35 PM
I will look later tonight or tomorrow when I can.

tmoore935
05-05-2005, 07:09 PM
Add _root and it should work.

Sound.onSoundComplete = function() {_root.gotoAndPlay("song2");}

is what you need to change. I also named the frames by using View>>List key frames.

the link for the demo is
http://www.diversioncentral.com/stream/player1goto.html
This will play forever and has only one swf to run it. The fun file is enclosed.

imladris
05-06-2005, 07:06 AM
tmoore935


THANKYOU!!!!!!! SORTED!!!! NOW I CAN GET DOWN TO IT!!! ONLY ANOTHER 20 ODD SONGS TO DO !!!:D

JUST GOT THE 2 DEMO SONGS LOADED IN AT THE MOMENT, UNTIL I GET TIME TO FINISH OFF THE REST OF THE SITE.

HEAR THE TWO DEMOS AND SEE THE DAMN THING WORKING PROPERLY AT www.martyn.guitarman.ukonline.co.uk

SURE MY BOSS IS HAPPY AS I'LL NOW BE CONCENTRATING ON DOING SOME PROPER WORK HEHEHEHE

:hubba:

imladris
05-12-2005, 12:37 PM
tmoore935
my site is nearly finished now-thanks for all your help. the test version is running at www.martyn.guitarman.ukonline.co.uk.

would be able to tell me why the attached doesn't show the vol or bytes values (d14 and d15)

as far as i can see i've applied it exactly the same as before, but to no avail.

it's driving me nuts!!!!!

thanks again

imladris

tmoore935
05-12-2005, 01:08 PM
Originally posted by imladris


would be able to tell me why the attached doesn't show the vol or bytes values (d14 and d15)


imladris

I dont't have time to check right now but try reseting your export settings as seen in the bmp attached.

You are from the UK? wereabouts the pond are you?:D

imladris
05-12-2005, 03:14 PM
thanks, the files are at work so i shall try that tommorow.

yes, i am from the uk about 60 miles north of london, although the band are based in Watford, which is about 30miles south of here.

Now that my site is nearly done, i've been roped into starting the designs for the new band website !! hehehe. just got started today: www.martyn.guitarman.ukonline.co.uk/afltindex.html

thanks again

imladris
05-13-2005, 04:30 AM
that's worked thanks !! would never have thought it was something so simple !!!

imladris

pherbrick
05-13-2005, 02:00 PM
Hi imladris, don't know if this is what hung up your work, but regarding the backward compatibility setting on dynamic text objects, some background might be useful. In Flash 4 and 5, text fields were represented by simple variables. In Flash 6 text fields became objects. So where it used to be txt1 = "whatever", for Flash 6 and 7 the parser expects txt1.text = "whatever". So to use some of the old KM sample code you will need to have the backward compatibility turned on, or recode for post Flash 5 standards.

Hmmm, may need to put this in the newbie FAQ.

Anyway, a good reference for learning AS is the AS Definitve Guide by Colin Moock (I recommend the 2nd edition, it has a really good Language Reference). Not everything in the book works in KM, in which case check the syntax help in the KM AS editor; if it is not there, then it probably is not supported. Next check the forum to see if what you want to do has already been discussed - several work arounds are documented here. The forum also has many threads on audio, drawing and compatibility issues. I've found answers to some of my questions in posts from a couple years ago.

Cheers.

Peter

noelle7
04-12-2006, 02:54 PM
Hi tmoore935 (or anyone else who can help me,)

This thread is pretty old, so I don't know if you'll get this message or not. It's worth a shot. This is my first post on this forum, I am very new to KoolMoves, and I don't know action script (or any coding language, for that matter.)

I really liked the files you created in post #3 or whatever it's called. I changed it a bit to suit my preferences but would just like to ask for your help on a few more things.

First, I am only using this for control of one background sound on a site. I would like the sound to loop indefinitely. Right now, it only plays once.

Also, instead of having play and stop icons, I just used the words "on" and "off." Is there a way to make only the word "off" be visible when the music is playing and only the word "on" visible when the music isn't playing?

Um....I guess I'm not sure how to post an attachment, so I will post this reply and then try to check that out how to post my files.

noelle7
04-13-2006, 01:48 PM
Here they are

tmoore935
04-13-2006, 09:39 PM
Here they are
I will look this weekend. Please tell me which version of koolmoves you are using.

tmoore935
04-13-2006, 11:48 PM
Your file keeps craching koolmoves so I quit looking at it.

Here is a way to do it. It is really 2 fun files which make 1 html and 2 swfs. If you look under Views>>action and sound overview you can see the commands and how to loop a sound. Make sure you extract both fun files/swf and html into the same folder. Place a song in the same folder and call it kool.mp3. This is so I don't have to upload a mp3 for the lack of space.

All this does is call one swf by using loadmovie. Then a different swf is called with the loadmovie. Since they are on the same level, when a swf is called, the other swf is over written.

noelle7
04-14-2006, 03:43 PM
Thanksk so much for your quick response. Sorry that my file kept crashing KoolMoves! It does that to me if I try to see the "actions and sounds overview." I thought it was because I did a Windows Update or something. If I look at each individual action through the other viewing methods, it's fine.

I'll take a look at what you sent me and will let you know if I can figure it out.

Thanks again!

noelle7
04-14-2006, 04:12 PM
I'm sorry. I guess I just don't understand. I opened both music stop.fun and music play.fun in KoolMoves. (The zip file didn't have any html page, so I'm not sure f it was supposed to or if you meant for me to create my own...If so, I'm not sure how to make an html page with both swfs.)

I looked at the actionscript for both files and don't understand it, but it's there. :) When I try to play it in the KM player, the file is blank (just a green background, not the sound graphic.) This is true for both the "play move" and the "stand alone player," It is also true when I tried to play it through Front Page. In Front Page, I also had a sound file called kool.mp3 in the same folder. In no instance do I hear the sound playing.

I just downloaded the newest version of KM (5.3) two days ago, but I created my original file on the older version, which I just downloaded last month.

Thanks again for your help. :)

tmoore935
04-14-2006, 09:27 PM
Actually you need only one swf. I belive if you want the music to start on its own, make a html for musicplay. If you want the music not to play right away make the html with musicstop.

The html only holds the swf. When a new swf is called, the original is erased inside the html.

To fix the problem erase this in both swf's (under actions and sounds)
this._x =0;
this._y =365;

This is left over from a previous web page. I forgot to get rid of it. I did not include a swf because of the limits of file size storage on this site. And I did not include music for the same reason. Do not use front page until you figure out how it works. Simply use File>>export movie>>save one as html and swf and the other as swf

noelle7
04-15-2006, 03:08 PM
Getting rid of the extra action script definitely helped. Thanks for clarifying what you meant with having one html file and how. I can now see the graphics, and they do change when I click on them.

Still, I don't hear any sound. I don't understand action script, so I don't even see anywhere where it references the sound "kool.mp3." I'm not sure what to change. I'll send you the files that I have changed.

I also made another version of the file that kept crashing KoolMoves before (the one based on post #3 that you made in this thread.) It's not crashing on my computer, so maybe it will work on yours. :)

I'm not sending you the sound files either. (I see what you mean about size limitations.)

Thanks again for taking time out of your schedule to help me!

tmoore935
04-15-2006, 09:48 PM
If you look under VIEW>>ACTIONS AND SOUND OVERVIEW, you see a small speaker icon. Click on it and you should see a reference to kool.mp3 and the ability to loop. For this to work on your computer you need a song called kool.mp3 or you need to change the name in the actions. This example plays the music with out AS by using the built in sound function.

Another way is to do this in a movie clip
onClipEvent (load) {
Sound = new Sound();
//to stream
Sound.LoadSound("kool.mp3", true);
Sound.start();
}

and in the main frame put volume = 100;

Ill posted a fun file redoing yours.

noelle7
04-18-2006, 12:27 AM
Thanks again for all of the work you've done to help me. I will take a closer look at what you have done later, because I just keep looking at it over and over, and I think that my brain is too fried from work today! The new file that you made looks great, as far as I can tell.

The older files "musicstop" and "musicplay" don't have a little speaker icon that I could see...The new file, 1a, does. :)

I'll get back with you. :)

noelle7
04-22-2006, 09:07 PM
I got it! Thank you so much for all of your help and work. The last fun file you posted was especially helpful. I ended up using the KoolMoves "add sound" function on the first frame and made it loop that way. I couldn't get it to loop using :

onClipEvent (load) {
Sound = new Sound();
//to stream
Sound.LoadSound("kool.mp3", true);
Sound.start();
}

though it did play it through one time that way.

I am building a website for my photographer friend, and she will be very pleased with what you did to help. :)

Here's a link the site, if you're interested: http://www.phokissphotography.com


I used frames, because the photo gallery program I used for some of the pages wasn't recognized by KoolMoves. Frames might not give the best result, but it's all I know how to do for the moment.

Thanks again!

tmoore935
04-22-2006, 09:19 PM
Glad I could help