Want player object to keep playing when going to another card
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 7
- Joined: Tue Mar 09, 2021 6:37 pm
- Location: Massachusetts
Want player object to keep playing when going to another card
I have a stack for playing MP3s. The first card has a field that has List Behavior checked. This lists all of my MP3s. I also have a player object on the card. When I click on a selection, the player plays that selection. That part works well.
I also have a separate card for each MP3. These cards have notes about each selection. My problem is when a song is playing and I go to the info sheet on that song, the music stops playing, and I want it to keep playing.
I have tried making my player into a group and marking it as “Behave Like a Background.” This allows the music to keep playing, but I don’t want the player object to appear on the info card (right in the middle of my info field.)
Does anyone have any suggestion how I can keep the player playing when I leave the card that the player object is on? Or is there a way to hide the player group on the Info Cards without it being hidden on the Player Card. I hope that I have explained this clearly enough. Any help would be appreciated.
I also have a separate card for each MP3. These cards have notes about each selection. My problem is when a song is playing and I go to the info sheet on that song, the music stops playing, and I want it to keep playing.
I have tried making my player into a group and marking it as “Behave Like a Background.” This allows the music to keep playing, but I don’t want the player object to appear on the info card (right in the middle of my info field.)
Does anyone have any suggestion how I can keep the player playing when I leave the card that the player object is on? Or is there a way to hide the player group on the Info Cards without it being hidden on the Player Card. I hope that I have explained this clearly enough. Any help would be appreciated.
Re: Want player object to keep playing when going to another card
Is it possible to have only one card do the job for you?
Have the player at the top of the card, and show info below then either:
1. Have the card the same size as the player only. When you 'show' the info, just resize the card to encompass the info box and player, and resize when you want to hide the info.
2. Have the player on a card, and have the info off screen, then resize the card and place the info on the front layer moving it on screen, effectively masking the player, and do the reverse to exit the process. I can't get this to work because the buffer for the player doesn't allow objects in front of the player.
3. Same as 2, but put the player off screen when the info is shown and the card resized.
Hope that makes sense.
XdM
Have the player at the top of the card, and show info below then either:
1. Have the card the same size as the player only. When you 'show' the info, just resize the card to encompass the info box and player, and resize when you want to hide the info.
2. Have the player on a card, and have the info off screen, then resize the card and place the info on the front layer moving it on screen, effectively masking the player, and do the reverse to exit the process. I can't get this to work because the buffer for the player doesn't allow objects in front of the player.
3. Same as 2, but put the player off screen when the info is shown and the card resized.
Hope that makes sense.
XdM
-
- Livecode Opensource Backer
- Posts: 9418
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Want player object to keep playing when going to another card
Personally I'd stick to a single card and have an image the same size as the card for each MP3,I also have a separate card for each MP3.
then I'd use show and hide as required.
Here's a demo of that sort of thing.
- Attachments
-
- DEMO X.livecode.zip
- (13.82 KiB) Downloaded 117 times
-
- Posts: 7
- Joined: Tue Mar 09, 2021 6:37 pm
- Location: Massachusetts
Re: Want player object to keep playing when going to another card
Thank you for your suggestions. They got me thinking further, and I have come up with a fairly simple solution. As mentioned above, when I make the player a group, the music continues playing when I go to other cards with that group on it, but it shows as a big black strip across my notes field. My solution is to put the following in the player card script. It hides the player when going to any of the notes cards, but the music keeps playing, and then it shows the player again when returning to the player card. By doing it this way, when I add songs to my library and add a new notes card, I don't have to add any script on the new card about showing or hiding the player.
Here is the script that I put into my playerDeck card. This is the only card where I want the player object (and now group) to be visible.
on openCard
set the visible of group myGroupedPlayer to true
end openCard
on closeCard
set the visible of group myGroupedPlayer to false
end closeCard
Here is the script that I put into my playerDeck card. This is the only card where I want the player object (and now group) to be visible.
on openCard
set the visible of group myGroupedPlayer to true
end openCard
on closeCard
set the visible of group myGroupedPlayer to false
end closeCard
Re: Want player object to keep playing when going to another card
Another way to tackle it might have been to put all the notes into a sub stack of the player that acts like a palette floating above the player. Two different sizes and styles that each are just right for their own purposes.
-
- Posts: 7
- Joined: Tue Mar 09, 2021 6:37 pm
- Location: Massachusetts
Re: Want player object to keep playing when going to another card
Thanks. I might try the sub Stack route later. I hadn't thought of that and haven't used sub Stacks yet.