all groups > macromedia flash sitedesign > march 2005 >
Hello- I am drawing somewhat of a blank on this. I have a button called "Change Music". What I want to do is have example: 4 mp3's on my website. When my visitor clicks on this button I would like it to change music to the next mp3. Example: The movie loads, and is playing 1.mp3, visitor cliks button then 2.mp3 plays etc.... To reduce swf size I would like "get URL" these mp3's. My thought was to do a for..loop script? Am I on the right track (no pun intended). Thanks
Try something like this on (release) { a++; if (a>3) { a = 1; } newSong.stop(); newSong = new Sound(); newSong.loadSound(a+".mp3", true); } This will work for three songs. 1,2,3 .mp3. Change the a>3 to how many tracks you want to have. This works off the root so if this is the ony audio you have it will work fine but you will probably want to attach the audio to movie clips. Good luck! [quoted text, click to view] "Anthony Brown" <anthony@kermy.com> wrote in message news:d2i162$dcr$1@forums.macromedia.com... > Hello- > I am drawing somewhat of a blank on this. > I have a button called "Change Music". What I want to do is have example: 4 > mp3's on my website. When my visitor clicks on this button I would like it > to change music to the next mp3. Example: The movie loads, and is playing > 1.mp3, visitor cliks button then 2.mp3 plays etc.... > > To reduce swf size I would like "get URL" these mp3's. > > My thought was to do a for..loop script? Am I on the right track (no pun > intended). > > Thanks > >
Great! That's exact;y what I needed. [quoted text, click to view] "zcan" <envelope@mindspring.com> wrote in message news:d2jbbk$8dd$1@forums.macromedia.com... > Try something like this > > on (release) { > a++; > if (a>3) { > a = 1; > } > newSong.stop(); > newSong = new Sound(); > newSong.loadSound(a+".mp3", true); > } > > > This will work for three songs. 1,2,3 .mp3. Change the a>3 to how many > tracks you want to have. This works off the root so if this is the ony > audio > you have it will work fine but you will probably want to attach the audio > to > movie clips. > Good luck! > > > > > "Anthony Brown" <anthony@kermy.com> wrote in message > news:d2i162$dcr$1@forums.macromedia.com... >> Hello- >> I am drawing somewhat of a blank on this. >> I have a button called "Change Music". What I want to do is have >> example: > 4 >> mp3's on my website. When my visitor clicks on this button I would like > it >> to change music to the next mp3. Example: The movie loads, and is >> playing >> 1.mp3, visitor cliks button then 2.mp3 plays etc.... >> >> To reduce swf size I would like "get URL" these mp3's. >> >> My thought was to do a for..loop script? Am I on the right track (no pun >> intended). >> >> Thanks >> >> > >
I am getting an error. Instead of coming up with 1.mp3 it says NaN.mp3 "not a number"? [quoted text, click to view] "zcan" <envelope@mindspring.com> wrote in message news:d2jbbk$8dd$1@forums.macromedia.com... > Try something like this > > on (release) { > a++; > if (a>3) { > a = 1; > } > newSong.stop(); > newSong = new Sound(); > newSong.loadSound(a+".mp3", true); > } > > > This will work for three songs. 1,2,3 .mp3. Change the a>3 to how many > tracks you want to have. This works off the root so if this is the ony > audio > you have it will work fine but you will probably want to attach the audio > to > movie clips. > Good luck! > > > > > "Anthony Brown" <anthony@kermy.com> wrote in message > news:d2i162$dcr$1@forums.macromedia.com... >> Hello- >> I am drawing somewhat of a blank on this. >> I have a button called "Change Music". What I want to do is have >> example: > 4 >> mp3's on my website. When my visitor clicks on this button I would like > it >> to change music to the next mp3. Example: The movie loads, and is >> playing >> 1.mp3, visitor cliks button then 2.mp3 plays etc.... >> >> To reduce swf size I would like "get URL" these mp3's. >> >> My thought was to do a for..loop script? Am I on the right track (no pun >> intended). >> >> Thanks >> >> > >
Got is fixed. Last question. is there a way to have the mp3 repeat? It plays once, and then stops. [quoted text, click to view] "Anthony Brown" <anthony@kermy.com> wrote in message news:d2judq$6ed$1@forums.macromedia.com... >I am getting an error. > Instead of coming up with 1.mp3 it says NaN.mp3 > > "not a number"? > > > "zcan" <envelope@mindspring.com> wrote in message > news:d2jbbk$8dd$1@forums.macromedia.com... >> Try something like this >> >> on (release) { >> a++; >> if (a>3) { >> a = 1; >> } >> newSong.stop(); >> newSong = new Sound(); >> newSong.loadSound(a+".mp3", true); >> } >> >> >> This will work for three songs. 1,2,3 .mp3. Change the a>3 to how many >> tracks you want to have. This works off the root so if this is the ony >> audio >> you have it will work fine but you will probably want to attach the audio >> to >> movie clips. >> Good luck! >> >> >> >> >> "Anthony Brown" <anthony@kermy.com> wrote in message >> news:d2i162$dcr$1@forums.macromedia.com... >>> Hello- >>> I am drawing somewhat of a blank on this. >>> I have a button called "Change Music". What I want to do is have >>> example: >> 4 >>> mp3's on my website. When my visitor clicks on this button I would like >> it >>> to change music to the next mp3. Example: The movie loads, and is >>> playing >>> 1.mp3, visitor cliks button then 2.mp3 plays etc.... >>> >>> To reduce swf size I would like "get URL" these mp3's. >>> >>> My thought was to do a for..loop script? Am I on the right track (no >>> pun >>> intended). >>> >>> Thanks >>> >>> >> >> > >
Try this on (release) { a++; if (a>3) { a = 1; } newSong.stop(); newSong = new Sound(); newSong.loadSound(a+".mp3", true); newSong.onSoundComplete = function() { newSong.loadSound(a+".mp3", true); }; } [quoted text, click to view] "Anthony Brown" <anthony@kermy.com> wrote in message news:d2k0bl$960$1@forums.macromedia.com... > Got is fixed. > > Last question. is there a way to have the mp3 repeat? It plays once, and > then stops. > > > "Anthony Brown" <anthony@kermy.com> wrote in message > news:d2judq$6ed$1@forums.macromedia.com... > >I am getting an error. > > Instead of coming up with 1.mp3 it says NaN.mp3 > > > > "not a number"? > > > > > > "zcan" <envelope@mindspring.com> wrote in message > > news:d2jbbk$8dd$1@forums.macromedia.com... > >> Try something like this > >> > >> on (release) { > >> a++; > >> if (a>3) { > >> a = 1; > >> } > >> newSong.stop(); > >> newSong = new Sound(); > >> newSong.loadSound(a+".mp3", true); > >> } > >> > >> > >> This will work for three songs. 1,2,3 .mp3. Change the a>3 to how many > >> tracks you want to have. This works off the root so if this is the ony > >> audio > >> you have it will work fine but you will probably want to attach the audio > >> to > >> movie clips. > >> Good luck! > >> > >> > >> > >> > >> "Anthony Brown" <anthony@kermy.com> wrote in message > >> news:d2i162$dcr$1@forums.macromedia.com... > >>> Hello- > >>> I am drawing somewhat of a blank on this. > >>> I have a button called "Change Music". What I want to do is have > >>> example: > >> 4 > >>> mp3's on my website. When my visitor clicks on this button I would like > >> it > >>> to change music to the next mp3. Example: The movie loads, and is > >>> playing > >>> 1.mp3, visitor cliks button then 2.mp3 plays etc.... > >>> > >>> To reduce swf size I would like "get URL" these mp3's. > >>> > >>> My thought was to do a for..loop script? Am I on the right track (no > >>> pun > >>> intended). > >>> > >>> Thanks > >>> > >>> > >> > >> > > > > > >
Thanks! [quoted text, click to view] "zcan" <envelope@mindspring.com> wrote in message news:d2kn58$90d$1@forums.macromedia.com... > Try this > > on (release) { > a++; > if (a>3) { > a = 1; > } > newSong.stop(); > newSong = new Sound(); > newSong.loadSound(a+".mp3", true); > newSong.onSoundComplete = function() { > newSong.loadSound(a+".mp3", true); > }; > } > > > > > > > > > > > > > "Anthony Brown" <anthony@kermy.com> wrote in message > news:d2k0bl$960$1@forums.macromedia.com... >> Got is fixed. >> >> Last question. is there a way to have the mp3 repeat? It plays once, and >> then stops. >> >> >> "Anthony Brown" <anthony@kermy.com> wrote in message >> news:d2judq$6ed$1@forums.macromedia.com... >> >I am getting an error. >> > Instead of coming up with 1.mp3 it says NaN.mp3 >> > >> > "not a number"? >> > >> > >> > "zcan" <envelope@mindspring.com> wrote in message >> > news:d2jbbk$8dd$1@forums.macromedia.com... >> >> Try something like this >> >> >> >> on (release) { >> >> a++; >> >> if (a>3) { >> >> a = 1; >> >> } >> >> newSong.stop(); >> >> newSong = new Sound(); >> >> newSong.loadSound(a+".mp3", true); >> >> } >> >> >> >> >> >> This will work for three songs. 1,2,3 .mp3. Change the a>3 to how many >> >> tracks you want to have. This works off the root so if this is the ony >> >> audio >> >> you have it will work fine but you will probably want to attach the > audio >> >> to >> >> movie clips. >> >> Good luck! >> >> >> >> >> >> >> >> >> >> "Anthony Brown" <anthony@kermy.com> wrote in message >> >> news:d2i162$dcr$1@forums.macromedia.com... >> >>> Hello- >> >>> I am drawing somewhat of a blank on this. >> >>> I have a button called "Change Music". What I want to do is have >> >>> example: >> >> 4 >> >>> mp3's on my website. When my visitor clicks on this button I would > like >> >> it >> >>> to change music to the next mp3. Example: The movie loads, and is >> >>> playing >> >>> 1.mp3, visitor cliks button then 2.mp3 plays etc.... >> >>> >> >>> To reduce swf size I would like "get URL" these mp3's. >> >>> >> >>> My thought was to do a for..loop script? Am I on the right track (no >> >>> pun >> >>> intended). >> >>> >> >>> Thanks >> >>> >> >>> >> >> >> >> >> > >> > >> >> > >
Don't see what you're looking for? Try a search.
|
|
|