How to detect links in text automatically

I'm working on Twitter client app and I want the URLs or links in the statuses behaves like a link.  I saw AIR apps like TweetDeck, DestroyTwitter and Twhirl which they show links as links though.

I've found a way at http://bit.ly/9OKEUl using regular expressions I'll test it now and hope it works.
Here is the way:
You could replace the URLs in your text for actual links using the following regex:
str = str.replace(/((https?|ftp|telnet|file):((\/\/)|(\\\\))+[\w\d:#@%\/;$()~_?\+-=\\\.&]*)/g, "<u><a href='$1'>$1</a></u>");
Then set the htmlText on a Label or Text component and listen for it's link event:
<mx:Text htmlText="{str}" link="linkHandler(event)"/>
Then open the URL on the handler:
public function linkHandler(event:TextEvent):void {
    navigateToURL(new URLRequest(event.text), '_blank');
from Stackoverflow.com

Similar Messages

  • How do you link 2 text boxes in new pages

    How do you link two text boxes in the new pages.  The old one was much easier to use.

    I think this is impossible! Ive been trying today and I couldnt do it. Then I opened up an old document that had text linking in it and I got a message telling me that the text boxes were now unlinked!  Why would you remove that? For me this software is now useless. How on earth do I get my old version back?
    <Edited by Host>

  • How can i link a text to a photo into a slideshow?

    hello, need some help please! i want to link a text to a specified photo into a slideshow, another word to another photo and so on...I've tried any slideshow, and composition with anchor points and it doesn't work. How can i realize that please?

    There's no support within Muse to cause click on a word within a flow of text to result in a slideshow turning to a specific image.
    A composition widget can be used to have clicking on or rolling over a trigger object cause a target container to appear.

  • How can detect link statius througth MII..?

    Hi
    I am trying to detect link status througth MII
    but I don't know how can access it.
    Thanks..
    Song

    javigomez88 wrote:
    I know that Brother has an app that works with its wireless printers, even if they are not airprint. My printer isn't wireless, is a wireless print server attached to the printer what is able to make this printer wireless. Could this app be a solution or only would work with the wireless Brother printers?
    The Apps usually only work with wireless printers, though if its free, there is no harm in trying, and see if it gets picked up, but its doubtful, as the print server would need to transmit in the same protocol the Brother Print App is expecting from the supported wireless printers. 

  • How do I link to text in a page, so it goes to the top?

    Hi All
    I have two columns; The first lists all links i.e. Delivery Info, How to Measure, Rates, etc etc.
    I the second column is all the answers to those questions.
    I have been using an anchor which will take the user to the text point. But now, I want every bit of text to appear at the top of the page.
    Is this possible?
    Thank you

    Sorry, you are not making sense to someone that has not seen your code. The best way to get assistance is to post a link to the site.
    In the meantime, the answer to the question is Yes if there is enough real estate.

  • Livecycle Designer 7.0 - How do I link a text box in a form to a radio button or checkbox?

    Hello,
    I am using Livecycle Designer 7.0 to create a form. I have a scenario where I have several options on a question where they choose one radio button. The last option of the radio button has a text box accompanying it and I only want it to be able to be filled out/typed into if that particular radio button is chosen. Not to be able to be typed into if that particular radio button is not chosen as an answer to that question.
    How do I do that?
    Also how to I do the same for a text box to be entered into and typed into only if the accompanying checkbox is checked?
    Help?

    This forum is for the Adobe FormsCentral  (formscentral.adobe.com) which is a service that allows you to create,  collect and analyze data using an online web form. You should ask  Designer related form questions in the Designer forums: http://forums.adobe.com/community/livecycle/livecycle_es/livecycle_des igner_es
    I'll move your post to that forum so you don't need to retype it. They can help you out...
    Randy

  • How to Add Link Some Text in RichEdit Control in MFC

    I need to add some Text with Link to RichEdit, thats all.
    for example,
    my String is,
    line 1 : PASS
    line 2 :  FAIL
    line 3 : PASS
    line 4 : FAIL
    line 5 : FAIL
    now i want to add this String into RichEdit. and add a Link to Only FAIL text. when i click the FAIL Text(ie, line2,line4,line5) it show some message using Message Box or AfxMessageBox.

    I decided to give it a go and wow it was way harder than I thought it should be.  Here is what I ultimately did. (you can try playing with ITextDocument2, ITextRange2::SetURL, but I didn't get that to work like I wanted.  I finally resorted to
    directly injecting RTF into my RichEdit control.  Here is a brief example (there is a little MFC in here to save time, but the relevant stuff is pure Win32 and the MFC is trivially convertable to Win32).
    m_rich.Create(WS_VISIBLE | WS_CHILD | ES_MULTILINE, CRect(10, 10, 200, 200), this, 1000);
    // TODO: Add extra initialization here
    m_rich.SetWindowText(L"This is a test ");
    m_rich.SetSel(-1, -1);
    m_rich.SetEventMask(ENM_LINK);
    std::string dataStr = R"({\rtf1{\field{\*\fldinst{ HYPERLINK http://example.com }}{\fldrslt{DisplayText}}}}.)";
    std::list<char> dataList(dataStr.begin(), dataStr.end());
    EDITSTREAM es = {
    reinterpret_cast<DWORD_PTR>(&dataList),
    0,
    [](DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) -> DWORD {
    auto &list = *(reinterpret_cast<std::list<char> *>(dwCookie));
    *pcb = 0;
    while (*pcb < cb && !list.empty()) {
    pbBuff[*pcb] = list.front();
    list.pop_front();
    (*pcb)++;
    return 0;
    auto r = m_rich.SendMessage(EM_STREAMIN, SF_RTF | SFF_SELECTION, reinterpret_cast<LPARAM>(&es));

  • How to hyper link the text that comes from database ?

    Hi all,
    Jdev Ver :11.1.1.4.0
    I have one usecase like, to highlight(using af:commandlink) the keywords from some content..
    And i have some set of keywords, and where ever the keywords appears in the content i need to show those words as a af:commandlink in the page ..
    Anyone aware of this kind of usecase ? Please suggest some ideas..
    thanks,
    Gopinath J

    Hi,
    It is not straight forward, here is the sample code to do that where i replaced the text key with the hyperlink and bounded it to outputText
        <af:outputText value="#{<Bean>.text}" escape="false"/>
        //variable text inside bean with setters and getters
        private String text = "This is a sample text where the text key is shown as hyperlink";
        public void setText(String text) {
            this.text = text;
        //replaces the text "key" references with the hyperlink
        public String getText() {
            text = text.replace("key","<a href=\"http://google.com\">key</a>"); //escape sequence the quote to provide value for href
            return text;
        }Sireesha

  • Linking Dynamic text boxes?

    Hi there,
    This might be straight forward, but I would like to know how could one link dynamic text boxes so that the information would flow? In a way, the information would flow from:
    (XML) Input A into BOXA00, BOXA01, BOXA02, BOXA03, etc.
    (XML) Input B into BOXB00, BOXB01, BOXB02, BOXB03, etc.
    (XML) Input C into BOXC00, BOXC01, BOXC02, , BOXC03, etc.
    Any takers?

    Hi i recently have made a function that can calculate the amount of text that will fit into a specified text box. See my attached file. Notice that the box will only accommodate the text in red since that is the maximum it can display.
    "This here one is a very very very long long long text that cannot really fit completely into this box so we will have to cut it at some index point"
    My function getTextExtent will return an object with properties
    nIndex -> which determines the index at which the text will be delimited
    fExceeded -> is true if the text is longer than the allocated height of the text field.

  • Did you know how to link the text in two or more text boxes?

    Did anyone know how to link the text in two or more text boxes in Pages 5.0? Thanks for your answer.
    Qualcuno sa come collegare il testo in due o più caselle di testo nella versione 5.0 di Pages. Grazie per le vostre risposte.

    It's just one of the many, many features that have been eliminated or changed. Leave feedback for the Pages team using the link in the Pages menu and review & rate the new versions in the Mac App Store.
    If you previously had iWork '09, those apps are still in your Applications folder in a folder named iWork '09. You can continue to use them to get things done.

  • My 10 yr old wants to text from his iPod touch. We have 1 family Apple ID. How can I monitor his texts without receiving all of his friends messages? Do I need a separate Apple ID or can I link a new email address to the same Apple ID?

    My 10 yr old wants to text from his iPod touch. We have 1 family Apple ID. How can I monitor his texts without receiving all of his friends messages? Do I need a separate Apple ID or can I link a new email address to the same Apple ID?

    Just an email address
    MacMost Now 653: Setting Up Multiple iOS Devices For Messages and FaceTime

  • How can I detect a certain text within a field within CASE using IF

    Dear all,
    for a transformation / generation of values receiving from R/3 into BW I try to
    manupulate three fields. I have a problem detecting a string in a field.
    I am using a CASE with several WHEN clauses on one field. Depending on the
    value, an IF is integrated. There I look into another field evaluating, if it contains
    a certain string. E.g. IF STRING CP 'xyz' OR 'abc'.
    System gives error for the locigal expression. I also tried CS, but same error.
    How can I detect a certain text within a field and which is the right logical
    expression.
    Many thanks in advance!!!
    Claudia

    Hi,
    Folow the blow example...
    May be it helps....
    DATA: hex1 TYPE string,
          hex2 TYPE string.
    hex1 = 'FFFF'.
    hex2 = '123FF'.
    IF hex1 CP hex2.
    ENDIF.
    Cheers,
    SImha.

  • How do I edit or remove text automatically added to a DITA layout?

    I'm evaluating FM11 with an eye toward using it to author our print manuals (along with all the reuse stuff that DITA will allow). I have some experience with DITA authoring in other applications, but FM is new to me.
    It's going to be up to me and a colleague to demonstrate how FM is an improvement over our current manual process (InDesign). One thing we need to demonstrate in particular is how we'll retain complete control over layout appearances (something we don't easily get in our other XML authoring tool).
    I've been playing with the "New" DITA task/reference/concept templates as they open, and I'm troubled to see that text automatically appears in some places and I can't edit it or delete it. For instance, an <info> tag adds the text "ADDITIONAL INFORMATION". We may not want that text to appear in our layouts, or we may want to change it. At the very least, I'll need to demonstrate that I have control over text like this. 
    I've looked through Reference Pages, EDDs, DTDs, INIs, and several other places, and I can't nail down the source of the (potentially) unwanted text. Can someone point me in the right direction?

    Hi ohnehosen...
    These strings are defined in the EDD, as autonumber text in the paragraph style, or on the reference pages. It sounds like you've checked all those places, but they *are* there. One problem that you may be running into with FM11 is that you're likely using DITA 1.2, and for DITA 1.2 there is a separate structure application for each topic type. That means you'll have different EDDs and templates to search through. If you modify an EDD you'll be needing to import that into the corresponding template.
    I strongly suggest that instead of modifying the default structure apps, you first clone the defaults to names of your own. Then you modify your custom apps and leave the default apps available unmodified for testing. You *will* break the apps at some point (everyone does), and without the default unmodified apps available for testing.
    If you don't need the DITA 1.2 model, you might consider using the DITA 1.1 apps, which (I believe) are just one app for all topic types.
    OR .. if you want a far simpler and reliable option for PDF publishing from DITA, you might check out DITA-FMx. This is a product that I sell, but it provides enhanced DITA authoring and publishing tools in FrameMaker ..
        http://leximation.com/dita-fmx/
    Cheers,
    ...scott
    Scott Prentice
    Leximation, Inc.
    www.leximation.com

  • How to link a text box to an anchor frame in the master pages?

    Ok, as the title states, we are trying to figure out if it is possible to link a text box to an anchor frame in the master page. When you look at our Master Page layout, we have a text box in the upper left hand corner of the left hand page, this is used for our machine serial numbers. Then we have an anchor frame that automatically fills out the figure number. Let's say I have pages 2 & 3 (left & right), they have a S/N at the top of the page for the machine, then pages 4 & 5 have a different S/N. If I have to add more pages in between pages 2 & 3 (bumping the current 4 & 5 to 6 & 7), the anchor frame bumps to the next page, but the S/N text box doesn't. Is there a way to fix it so that they both move to the next page? Thanks for the help.
    P.S. I can include images and other info if needed.

    I have included a two pictures that should help me explain.
    Master Page:
    This is the master page set up, the "Page Text Box" has the flow set to "B" while the S/N text box has the flow set to "A". This setup is for our parts manuals, the left page is usually an illustration while the right page is usually a parts list. The text box, anchored frame & paragraph tag are empty in the master page set up. The "page text box" has a flow of "B" and the "S/N text box" has a master flow of "A".
    Body Page 1:
    When we create new pages, the paragraph tag automatically fills in the figure title on the left page, then we add an anchor frame within the text box to hold the illustration. You will notice that I added in a "test" serial number at the top of the page. Now if I need to go back and add two pages before this, the anchor frame, illustration and parts list will move to a new page, but the S/N text box will not. The "Before S/N TBD" would stay on the original page.
    This is what happens, the text box containing the illustration and the parts list "bump" to the next page, but the S/N text box does not. So the question we have is there a way to link that text box to the page so when we create new pages the S/N text box moves with the illustration.
    Does this help?
    Thanks for the assistance Error7103.

  • How can I view the underlying URL to a hypertext link in text from galley or story mode?

    How can I view the underlying URL to a hypertext link in text from galley or story mode?

    click inside the hyperlink and open Window > Hyperlinks (in InCopy). The link is highlighted there. If you can't see it in the editable field, double-click the highlighted entry and it'll open in a dialog box.
    AM

Maybe you are looking for

  • Creation of Business Parterns using tcode BP.

    Hi All, I am in process of uploading the legacy data to SAP for transaction code BP. I have found some bapi's too, which allow me to create a business partner and assign a role. Now i have to give the Grant Type data, company details like Dunn.proced

  • Character Formats showing up in TOC

    TOC entries for, say, "Heading4", are nominally controlled by the paragraph format of the generated "Heading4TOC" format. Sometimes the body narrative will have local mods to the Heading4 text. Depending on what you're doing, you may want those mods

  • How do share a very large file?

    How do share a very large file?

  • Module pool screen

    Hi all, I have developed a modulepool screen...this screen is used for saving vendor details into databse tables...so,here i m entering the vendor number and its details and then save it by using a pushbuton...My problem here is when i enter a vendor

  • Mountain lion combo updater

    I can't find a download link for the 10.8 combo updater.  Does it usually take a while after release for that to appear?