mouseUp/Down event

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
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

mouseUp/Down event

Post by phaworth » Sat Jul 11, 2009 1:17 am

I have a list field on my card with a mouseUp message handler in its object script. When I click on a line in the list, the handler is never called (I have an answer command as the first statement to let me know it's being executed). Same thing if try to use a mouseDown.


Still evaluating the demo so maybe I'm not understanding this but it should work, shouldn't it?

Also, on an unrelated topic, is there a card property for the number of objects on a card?

Thanks,
Pete

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Jul 11, 2009 1:43 am

Hi Pete,

Are you absolutely sure that you created a list field? Is the listBehavior property of the field true and is the lockText true as well? The lockText must be true for the mouseDown and mouseUp mesages to be sent.

You can retrieve the number of objects with the controls property:

put the number of controls of this cd

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Sat Jul 11, 2009 1:54 am

Hi Mark,
Yes the listBehavior ( and click to toggle) is true and so is lockText. The object script just has:

on mouseUp
answer information "entering mouse up"
end mouseUp

and I never get the message when I click on the list. Whatever I click on is highlighted so seems like the click is recognised at some level.

Pete

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Sat Jul 11, 2009 4:56 am

phaworth wrote:Hi Mark,
Yes the listBehavior ( and click to toggle) is true and so is lockText. The object script just has:

on mouseUp
answer information "entering mouse up"
end mouseUp

and I never get the message when I click on the list. Whatever I click on is highlighted so seems like the click is recognised at some level.

Pete
A thought came to me, did you check your stack or card script for a mouseUp message? The possible reason why the mouseUp message isn't getting sent to your field object is because you have a mouseUp message on a card or a stack or some control that is over that field.
Parañaque, Philippines
Image
Image

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Sat Jul 11, 2009 5:20 am

Checked the card script and the stack script and no mouseUp handlers in either one of them. same for all the other objects on the card.

This object is on a tab button - would that make any difference?
Pete

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Sat Jul 11, 2009 5:45 am

Supposedly no. Hmm if it makes any difference, here's a sample stack I made awhile ago. I may have to reply at some later point because I'm at school and it's only break time. xD

http://www.mediafire.com/file/imthd0jtw ... sample.rev
Parañaque, Philippines
Image
Image

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Sat Jul 11, 2009 6:24 am

I'm sure this has something to do with my problem. I just quit Revolution and restarted it and got a window with title "Errors" when I opened the stack I'm working on. The rest of the info in the window says:

Compiling at 10:56:55pm
Type: Expression: Missing Factor
Object Products
Line BTgetProductInfo()
Hint )

I had to type the above in manually since the window won;t let me copy the text.

BTGetProductInfo is a function I wrote that gets called at the card open message and also at the mouse up event. It returns no values, just gets values from an SQLite db and puts them into fields on the card.

SO I guess now I'm wondering why I'm just starting to get this error message and most of all, what it means so I can fix it.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Jul 11, 2009 9:25 am

phawort,

Perhaps you should click that little blue-ish square in the script window and correct the error that's displayed in the bottom of the script window?

You should probably also read up on the message hierarchy. Read the first part of the docs included with Revolution or go here.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Sat Jul 11, 2009 5:41 pm

I have read and understood the message hierarchy. I have three scripts, card, stack, and object. The only one that includes a mouseUp handler is the script for the list field handler.

The problem is obviously being caused by the compilation error and I would have fixed it without bothering the forum if there was any clue as to what the error "Missing Factor" means anywhere in any of the documentation.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Jul 12, 2009 9:13 am

Dear phaworth,

Please, post the offending part of your script.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Sun Jul 12, 2009 5:27 pm

It's OK, I figured out the problem and all is working OK. My demo expired yesterday and I'm about to purchase the full product today.

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Mon Jul 13, 2009 11:09 am

phaworth wrote:It's OK, I figured out the problem and all is working OK. My demo expired yesterday and I'm about to purchase the full product today.
Welcome to Rev then... Image
Parañaque, Philippines
Image
Image

Post Reply