Starting a player from another card

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
meerkat
Posts: 3
Joined: Thu Sep 05, 2013 4:42 am

Starting a player from another card

Post by meerkat » Mon May 12, 2014 1:59 pm

I'm using LiveCode Community Edition 6.6.0 build 4003 on a MacBook Air running Mac OS 10.7.5

I have a audio player called "playerNote" on card "cardA" that plays a WAV file lasting about 2 sec.
Player "playerNote" plays fine when invoked by buttons or other calls from card "cardA", as in first example below.
Now I want to play "playerNote" when I click a button on card "cardB" or I make calls from card "cardB", as in the second example below.
However in the second case, where the player is being started from a card other than the one it is on, the player is not sounding

/*Script and player are both on card "cardA" */
on mouseUp
start player "playerNote"
end mouseUp

/*Script is on card "cardB" but player is still on card "cardA" */
on mouseUp
start player "playerNote" of card "cardA" of stack "myStack"
end mouseUp

I can't see what is probably an obvious problem, so thanks for any suggestions!

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Starting a player from another card

Post by Klaus » Mon May 12, 2014 2:09 pm

Dag meerkat,

the player need to be on the same card where you "start" it.
Does not work any other way!

You can do this:
1. on card "cardA" select the player object and GROUP it!
Yes a single object :D

2. PLACE that new group also on card "CardB"
-> go to card "cardB"
-> select menu "Object"
-> "Place group"
-> and select your new group to place it onto card "cardB"

Now you can also:
...
start player "playerNote"
...
on that card!

Best

Klaus

Post Reply