View Full Version : Need help please, with Mp3 Player in MX....
toaster
09-16-2003, 09:44 AM
I have made and mp3 player that the design expands and contracts the mp3 player like "itunes". It also has a "drag" on it so you can move the player around.
When you open the player it plays the 1st song straight away, which is fine, BUT when u contract the player then re-open it plays its self again, but u are hearing both at the same time but one delayed. This also screws up the buttons as well.
Any ideas how I can make this wk the way it should?
I originally used a tutorial to get as far as making it work, my additions were the "drag" & "contract & expand".
Driving me nuts
Here is the fla.
farafiro
09-17-2003, 09:48 AM
just add stopAllSounds() to your code when contract the player
toaster
09-17-2003, 10:22 AM
here is the code where I think the problem is...."I think". I am not sure how to root the problem out. Still a novice, I am.
I have used so many diffrent tut's for this, but wish I took note who done what & from where.
CONTRACTED PLAYER
1st frame
on (press) {
gotoAndPlay(2);
}
EXPANDED PLAYER
Action Layer/Frame 2
radioVisible = false;
Music Layer/Frame 2
s = new Sound();
s.loadSound("my_music.mp3", true);
currentTrack="my_music";
stopped=false;
paused=false;
stop();
-------------------------------------BUTTONS------------------------------------------
PLAY BUTTON
2nd frame
//play button
on (release) {
//Play button.
//Sound is not playing and has not been paused
if (playing!=true) {
if (paused!=true) {
playing=true;
paused=false;
stopped=false;
myConditionText="playing";
s.start(0,0);
}
//Sound has been paused
if (paused==true) {
playing=true;
paused=false;
stopped=false
s.start(myMusicPosition,0);
myConditionText="playing";
s.onSoundComplete = function() {
s.start();
}
}
}
}
GRIP "on contracted player"
1st frame
on (press) {
startDrag(getProperty(_x, _y));
}
on (release) {
stopDrag();
}
--------------------------------------
toaster
09-17-2003, 10:28 AM
when its contracted I still want the user to still hear the selected mp3 playing. I just don't want it to play tha same song when you expand again.
Say for example:
1) when you first expand and the interface, "my_music.mp3" plays. This is cool:)
2) When the user contracts the player, they can still hear the selcted song playing. This is also cool.:cool:
3) when the user re-expand the interface it plays "my_music.mp3" again over the top the same song,"my_music.mp3". This is not cool.:mad:
So its like its repeating the action, but just don't know how to code it to make it stop repeating.
If you have a look at the fla, it might be a bit clearer. I suck at explaining things....:(
toaster
09-17-2003, 10:33 AM
just like "win amp/itunes/quicktime or real player interfaces" when you minimize the player, it still plays, when you expand the there are no interruptions of music play, unles you pause or stop.
toaster
09-17-2003, 10:35 AM
I have been trough many mp3 tutorials & search many forums...just not one that will help fix my prob.
desperately need help:(
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.