sIFR 3 rev 436 - copy link to clipboard
- by Alan Forsyth
This was originally a question, but is now a code enhancement, since it's a very minor (but useful) update.
When heading (or other) text is used as a link with sIFR 3, you now get the two 'open link / open link in new window' options in the right-click flash context menu for the link.
When I came across sIFR for the first time yesterday, I was wanting to copy a header (h2) link to the clipboard, on a site that used sIFR 2.x, and was frustrated that I couldn't.
Thanks to the wonders of open source (and well written code), I can suggest the following enhancement to sIFR 3:
[In the file flash/sIFR.as, find the section starting with the comment "// Have to set up menu items first!" through to ");" and replace with the following, then add font information to the .fla and export the swf as per the tutorial:]
// Have to set up the menu items first!
menuItems.push(
new ContextMenuItem("Follow link", function() { getURL(sIFR.instance.primaryLink, sIFR.instance.primaryLinkTarget) }),
new ContextMenuItem("Open link in new window", function() { getURL(sIFR.instance.primaryLink, "_blank") }),
new ContextMenuItem("Copy link to clipboard", function() { System.setClipboard(sIFR.instance.primaryLink) })
);
Now I'm happy... :-)
Alan.