What's wrong with this code?

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
UtahCode197
Posts: 21
Joined: Sat Jun 22, 2013 9:36 pm

What's wrong with this code?

Post by UtahCode197 » Sat Jun 22, 2013 10:16 pm

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: What's wrong with this code?

Post by Simon » Sat Jun 22, 2013 11:42 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

UtahCode197
Posts: 21
Joined: Sat Jun 22, 2013 9:36 pm

Re: What's wrong with this code?

Post by UtahCode197 » Sun Jun 23, 2013 8:43 am

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 :)

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

Re: What's wrong with this code?

Post by Klaus » Sun Jun 23, 2013 11:28 am

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

Post Reply