Page 1 of 1

mouseUp/Down event

Posted: Sat Jul 11, 2009 1:17 am
by phaworth
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

Posted: Sat Jul 11, 2009 1:43 am
by Mark
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

Posted: Sat Jul 11, 2009 1:54 am
by phaworth
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

Posted: Sat Jul 11, 2009 4:56 am
by shadowslash
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.

Posted: Sat Jul 11, 2009 5:20 am
by phaworth
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

Posted: Sat Jul 11, 2009 5:45 am
by shadowslash
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

Posted: Sat Jul 11, 2009 6:24 am
by phaworth
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.

Posted: Sat Jul 11, 2009 9:25 am
by Mark
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.

Posted: Sat Jul 11, 2009 5:41 pm
by phaworth
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.

Posted: Sun Jul 12, 2009 9:13 am
by Mark
Dear phaworth,

Please, post the offending part of your script.

Best,

Mark

Posted: Sun Jul 12, 2009 5:27 pm
by phaworth
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.

Posted: Mon Jul 13, 2009 11:09 am
by shadowslash
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