PDA

View Full Version : ScrollingMessageFrame Clickable Links


Unibus
02-02-2007, 01:56 PM
Hi.

Anyone know how i can make links clickable in a ScrollingMessageFrame ??

Klishu
06-02-2007, 10:17 PM
Hi Unibus. This is what you have to do:

To make links clickable in a ScrollingMessageFrame you will have to first add a message to your Message Frame somehow first:

/script MyMsgFrame:AddMessage("|cff1eff00|Hitem:3577:0:0:0:0:0:0:276308480|h[Gold Bar]|h|r");If the above doesn't work try:
/script MyMsgFrame:AddMessage("\cff1eff00\Hitem:3577:0:0:0:0:0:0:276308480\h[Gold Bar]\h\r");

Like this we've added a link to a Gold Bar item to the message frame. Now to make the link clickable you will need to add an <OnHyperlinkClick> to the scripts of MyMsgFrame. Your XML file will look like this:

<ScrollingMessageFrame name="MyMsgFrame" ... and some other stuff>
... Anchors, Sizes and other stuff ...
<Scripts>
<OnHyperlinkClick>SetItemRef(link,text,button);</OnHyperlinkClick>
</Scripts>
</ScrollingMessageFrame>

That's it! You've got a message frame that handles links.

Klishu

Unibus
11-02-2007, 12:39 AM
Thank you very much :D

chonli
13-09-2008, 07:28 PM
Hi, i'm trying to use your snippet and it doesn't works for me (scroll is empty always).

I'm using Addon Studio.

[CODE]
function btnEnviar_OnClick()
--put your event handler logic here
smfLista:AddMessage("\cff1eff00\Hitem:3577:0:0:0:0:0:0:276308480\h[Gold Bar]\h\r");
end


function smfLista_OnHyperlinkClick()
--put your event handler logic here
end



Thanks in advance.

Tunga
14-09-2008, 10:37 AM
Hmm, doing it from within Lua, I think you need to map the functions to the events first?