sIFR 3 rev 436 - copy link to clipboard

Posted by Alan Forsyth on Stack Overflow See other posts from Stack Overflow or by Alan Forsyth
Published on 2009-03-11T10:30:41Z Indexed on 2010/04/04 15:03 UTC
Read the original article Hit count: 338

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about sifr

Related posts about flash