Skip to main content
May 10, 2006
Question

Why aren't my other music files working!?!?

  • May 10, 2006
  • 5 replies
  • 390 views
Here's the code...

// initialize starting track
var soundNext:String = "beats01";
// set up dynamic sound object
var dynamicSound:Sound = new Sound(this);
dynamicSound.attachSound(soundNext);
dynamicSound.start(0, 1);
nowPlaying.text = soundNext;
beats01.onRelease = beats02.onRelease = beats03.onRelease = beats04.onRelease = beats05.onRelease = beats06.onRelease = beats07.onRelease = beats08.onRelease=function () {
soundNext = this._name;
nextTrack.text = soundNext;
};
// trigger next sound
dynamicSound.onSoundComplete = function() {
dynamicSound.attachSound(soundNext);
dynamicSound.start(0, 1);
nowPlaying.text = soundNext;
};
// stop the timeline
stop();

beats05-08 aren't working. I press the button and it gives the name of the song but plays the current one instead. Could it be because the first 4 are the same size while the last 4 vary?

He's random other code.


function drag() {
this.startDrag(false, -50, -50, 50, 50);
this.onEnterFrame = function() {
pan = 2*this._x;
vol = 50+this._y;
loopSound.setPan(pan);
loopSound.setVolume(vol);
this._parent.pan.text = pan;
this._parent.vol.text = vol;
};
this.onMouseMove = function() {
updateAfterEvent();
};
}
function drop() {
this.stopDrag();
delete this.onEnterFrame;
delete this.onMouseMove;
}
This topic has been closed for replies.

5 replies

Inspiring
May 11, 2006

"DumbFudge" <webforumsuser@macromedia.com> wrote in message news:e3tv5q$7gk$1@forums.macromedia.com...
> I've gotta have this done in like an hour... The last part that I can't find
> out... HELP!
>
> I think it has something to do with this code:
> dynamicSound.onSoundComplete = function() {
> dynamicSound.attachSound(soundNext);
> dynamicSound.start(0, 1);
> nowPlaying.text = soundNext;
> };
>
> Not sure though.

Quick test of your code.. it works fine. Must be a problem with linkage names for the sounds in the library like TimSymons said, or
you forgot to put instance names on those 4 buttons for beats05 to beats08.

I would do the button assignments a different way, but it works either way if the sound and button objects exist.

for (a = 1; a<= 8; a++)
{
var btn = this["beats0"+a];
btn.onRelease = function()
{
soundNext = this._name;
nextTrack.text = soundNext;
}
}

tralfaz


Participating Frequently
May 11, 2006
Did you make sure to export beats05 - 08 for actionscript in the library? This is a common mistake I make...more than I would care to admit.

Tim
Inspiring
May 11, 2006
Try renaming the beats05 to something else or something... like rename beats05 to beats01 and beats01 to beats05. If there is a problem with the things after 04, then it shouldn't play. But if it does play and doesn't play beats01, I don't know what's wrong. It seems to look correct... (maybe it's the buttons?)
May 11, 2006
I've gotta have this done in like an hour... The last part that I can't find out... HELP!

I think it has something to do with this code:
dynamicSound.onSoundComplete = function() {
dynamicSound.attachSound(soundNext);
dynamicSound.start(0, 1);
nowPlaying.text = soundNext;
};

Not sure though.
May 11, 2006
Uh... help please.

The first 4 sounds (beats01-04) work fine. When I press the buttons for them they work fine and go on to the needed song.

I can't find out why my next four songs aren't working...

It's annoying.