Page 1 of 1

Starting a player from another card

Posted: Mon May 12, 2014 1:59 pm
by meerkat
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!

Re: Starting a player from another card

Posted: Mon May 12, 2014 2:09 pm
by Klaus
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