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
What's wrong with this code?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: What's wrong with this code?
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
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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 21
- Joined: Sat Jun 22, 2013 9:36 pm
Re: What's wrong with this code?
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
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?
Hi Rory,
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
1. After setting the desired width/height, set the lockloc of that player to true!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
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