Thread Tools Display Modes
12-29-05, 02:25 PM   #1
qweqq
A Defias Bandit
Join Date: Dec 2005
Posts: 3
Need help with OnClick event

i want to open an error frame with a message in it when i click on for example frame1. I added:

<Frame>
..
<Scripts>
<OnLoad>
frame1_OnLoad();
this:RegisterForClicks("LeftButtonUp","RightButtonUp")
</OnLoad>
..
<OnClick>
message("hello");
</OnClick>
</Scripts>
</Frame>

But when i log in the game the following error appears:

Error: [string "frame1:OnLoad"]:3: attempt to call method `RegisterForClicks' (a nil value)

Can you help me to make it working ?
  Reply With Quote
12-29-05, 05:21 PM   #2
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Frames don't have the RegisterForClicks method. Buttons and its derivatives (like CheckButton) do.

Frames receive an OnMouseUp however. You can use that instead of OnClick:

<Frame>
..
<Scripts>
<OnLoad>
frame1_OnLoad();
</OnLoad>
..
<OnMouseUp>
message("hello");
</OnMouseUp>
</Scripts>
</Frame>
  Reply With Quote
12-29-05, 08:17 PM   #3
qweqq
A Defias Bandit
Join Date: Dec 2005
Posts: 3
Smile Thank You

Thank You very much. :
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Need help with OnClick event


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off