Page 1 of 1

What's wrong with this code?

Posted: Sat Jun 22, 2013 10:16 pm
by UtahCode197
I've written this bit of code:

on mouseUp
start command
start player "player"
end mouseUp

It says it's stuck at the second line. What's wrong with it?

Thanks

Re: What's wrong with this code?

Posted: Sat Jun 22, 2013 11:42 pm
by Simon
Hi Rory,
Welcome to the forum! :)

With a Player and button control dragged onto a new stack all you need is
on mouseUp
start player "player"
end mouseUp

But noticed that I said NEW, sometimes when working with a stack you may end up accidentally dragging more players onto the stack and the code above will only work on the first player object.

Now, maybe you don't have the file path setup correctly? In the player inspector under Basic Properties make sure the path to your Source is correctly defined.

Also the type of file may cause you grief, there are so many codecs. Try just a simple .mov.

Simon

Re: What's wrong with this code?

Posted: Sun Jun 23, 2013 8:43 am
by UtahCode197
Thanks for your reply! It works now.

Another problem is though...how do I get the video player to keep its dimensions?
And my last question is: How can I change the player's source with a text field?

Thanks again :)

Re: What's wrong with this code?

Posted: Sun Jun 23, 2013 11:28 am
by Klaus
Hi Rory,
RoryJMcEwan wrote:Thanks for your reply! It works now.
Another problem is though...how do I get the video player to keep its dimensions?
And my last question is: How can I change the player's source with a text field?
Thanks again :)
1. After setting the desired width/height, set the lockloc of that player to true!
Inspector for the video -> Size and Position -> Lock size and position (lockloc)

2. Set the FILENAME of your player to the fields content:
...
put the text of fld "the one with the video pathname" into tVideoPathName
set the filename of player "your player here" to tVideoPathName
...

Please also check these stacks to get accustomed to the Livecode basics:
http://www.hyperactivesw.com/revscriptc ... ences.html


Best

Klaus