• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1302
  • Last Modified:

Loop in Flash "set volume" sound object

hi,
 i've been using Flash5 's  new feature of sound object.
here i can only use a sound  that plays only once, i want that sound to play in continous loop... like 500 loops etc.  

 just because we don't put the imported sound on frame to use this feature.. we cannot use the conventional sound editor for making loops.  

 i just need a solution to make loops in "sound object> setVolume"  in flash, that controls the sound volume.

any expert tips ???

 Brain*  

 
0
Brain-storm
Asked:
Brain-storm
  • 4
  • 2
1 Solution
 
jeffbeasleyCommented:
I don't believe there is a way to do this unless you Know the set frame length of your sound. If you do know the set lenghth of your sound then you could have an empty mc that in the first frame has

sound_loop= new Sound();
sound_loop.attachSound("some_sound");
sound_loop.start();

and in the frame that would be equal to the length of your sound gotoAndPlay(1);

I am testing some ways to accomplish this without the work around.

I will let you know if this can be done

Jeff


0
 
jeffbeasleyCommented:
never say never
I got it to work
I have an example file at
http://www.jeffbeasley.com/downloads
called sound_loop.fla
and sound_loop.swf

The scripting is below
Hope this helped
Jeff

Script

function sound_volume (input) {
     if (_root.sound_loop.getVolume()>0) {
          _root.sound_loop.setVolume(_root.sound_loop.getVolume()+input);
          volume = _root.sound_loop.getVolume();
     }
}
function sound_attach (loop_number) {
     sound_loop = new Sound();
     sound_loop.attachSound("sound_link");
     sound_loop.start(0, loop_number);
}
0
 
jeffbeasleyCommented:
If you need additional help let me know I also have a file called sound_fade that may help
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Brain-stormAuthor Commented:
Hi Jeff:
 
 i really appreciate yur help. but the kind of .FLA u offered isn't the kind of result i need,  

 i just want the volume slider working with a loop .. continous loop..  like whenever the movie loads , the music starts as it loads and the music plays continously in a loop with a volume slider ...  slide it down > the volume gets LOW and slide it up > the volume gets high.... if u can find a solution .. pls inform

 BTW: always send yur tips as a comment.. never propose it as an answer ,, u never know what are the requirement on the other side :)

 thanx again for yur efforts.

 Brain*
0
 
jeffbeasleyCommented:
I added the draggable volume  
the example file is at and named the
same as the other file was
http://www.jeffbeasley.com/downloads
 sound_loop.fla
 sound_loop.swf


Jeff
0
 
Brain-stormAuthor Commented:
Jeff:   you solved my problem...

    now i can actually set the code according to my need ,
thanks for yur help.

 Cheers !!

 *Brain-Storm
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now