How to find rects of hyperlinks within a block of text?

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default How to find rects of hyperlinks within a block of text?

    Hi,

    In order to increase display speed of large scrollable blocks of rich text,
    I'm grabbing their image and then using imaging Lingo to display it. For
    this solution to work for our project, though, I need to find a way to
    support hyperlinks within the text.

    I reckon I can handle the on enterFrame stuff to check whether the mouse is
    over one or not - if I have a Hotspots proplist containing the rects of all
    the hotspots in an image then

    <ultrapseudocode>
    on enterframe me
    if mouse has moved since the last enterframe then
    work out where mouse is relative to image reg. point
    repeat with each rect in Hotspots list
    if rect is within view (i.e. not scrolled off the page
    somewhere)
    if mouse is in the rect then
    woohoo!
    etc
    </upc>

    but I've no idea how to populate the Hotspots list in the first place. I
    know there's a way of finding out if a particular word is under the mouse,
    and I can certainly find the hotspots within the text but...

    Any suggestions, pointers much appreciated.

    h


    h Guest

  2. Similar Questions and Discussions

    1. Centering text vertically in a text block
      I just bought Freehand MX 11 for Mac OS X and from using it back in the mid 1990s I could have sworn you could center text vertically in a text...
    2. Flash Text Hyperlinks
      I have some text in flash that's scrolling and hyerlinks, now that I brought the swf file into director, the hyperlinks don;t work. HELP!!!! J
    3. Missing text (flush right text block) upon export to pdf
      I was aghast today to see and ad in the local paper (that I worked on and got client approval for) missing text at bottom of ad. I am using FH 10 in...
    4. how to add several hyperlinks to a text?
      in article bi7l05$1ru$1@forums.macromedia.com, SimonBaum at webforumsuser@macromedia.com wrote on 8/23/03 8:00 AM: Assuming that works (I...
    5. find physical blocks/disks, mapped from Oracle file# and block#, block corruption
      Hello "lopera" <prlopera@techie.com> schrieb im Newsbeitrag news:3E1C7C00.9090402@techie.com... I think that we need a bit more data here....
  3. #2

    Default Re: How to find rects of hyperlinks within a block of text?

    While text is a text member get it's hyperlinklist

    hl = member("Glossary").hyperlinks
    -- [[3, 8], [10, 16], [41, 54]]


    boxLeft = charPosToLoc(member,"Glossary" hl[3][1]) -- 3rd link

    This basic code could get the start and end char of hyperlinks, just
    need to guess or get the line height the establish line height, and
    maybe get position of char after link end to establich box right


    should be able to generate a reasonable hyperlink rect list with this
    approach., thickey thing would be a hyperlink that word wraps over 2
    lines.
    JB Guest

  4. #3

    Default Re: How to find rects of hyperlinks within a block of text?

    If you are displaying a bitmap image as the text, then just use some
    toolbox sprites to create those hot spots. Select the empty rectangle
    tool, specify a line width of no width and draw a rectangle around the
    string that you want to use as a link. This will draw a new sprite on
    the stage and create a new shape member. Attach a behavior to that
    toolbox sprite to open the URL. Repeat as necessary.

    --
    Rob
    _______
    Rob Dillon
    Team Macromedia
    [url]http://www.ddg-designs.com[/url]
    412-243-9119

    [url]http://www.macromedia.com/software/trial/[/url]
    Rob Dillon Guest

  5. #4

    Default Re: How to find rects of hyperlinks within a block of text?

    "Rob Dillon" <rob@ddg-designs.com> wrote in message
    news:301020030852275851%rob@ddg-designs.com...
    > If you are displaying a bitmap image as the text, then just use some
    > toolbox sprites to create those hot spots. Select the empty rectangle
    > tool, specify a line width of no width and draw a rectangle around the
    > string that you want to use as a link. This will draw a new sprite on
    > the stage and create a new shape member. Attach a behavior to that
    > toolbox sprite to open the URL. Repeat as necessary.
    Thanks Rob - I'd already considered creating the Hotspots manually but with
    over 1400 'text-images', each with somewhere between none and 20 hotspots I
    wanted to find a way of doing it dynamically/programmatically. Plus the
    bitmap images *may* be larger than the area I have to display them in so I
    have to be able to scroll them. Then we're back to the reason I need to use
    images rather than just text boxes - scrollable text is too damn slow! Have
    to use imaging lingo just to get decent performance. Plus the client has
    started delivering assets that have images embedded in the text so a custom
    display mechanism is the only way.

    If I can't find a way of getting Director to do it on the fly I'll write a
    tool in Director to allow one of our art-gophers to mark out hotspots
    quickly as they're putting all the text in.

    Many thanks anyway,

    h


    h Guest

  6. #5

    Default Re: How to find rects of hyperlinks within a block of text?

    If you're working with that much content then you might want to
    consider using Flash .swf files for each of the text members. You can
    set all of your hyperlinks right in the flash file.

    Link, rather than import the flash .swf into your Director movie. Then
    you can use it just like the bitmaps that you have now. Since the Flash
    ..swf is linked, the hyperlink will still function.

    I would use a link to a Director function and not just use a URL in the
    Flash .swf. In the Director function you can better control opening the
    browser.

    --
    Rob
    _______
    Rob Dillon
    Team Macromedia
    [url]http://www.ddg-designs.com[/url]
    412-243-9119

    [url]http://www.macromedia.com/software/trial/[/url]
    Rob Dillon Guest

  7. #6

    Default Re: How to find rects of hyperlinks within a block of text?

    "JB" <lingoguy@sbcglobal.net> wrote in message
    news:lingoguy-480B4A.01384530102003@forums.macromedia.com...
    > While text is a text member get it's hyperlinklist
    >
    > hl = member("Glossary").hyperlinks
    > -- [[3, 8], [10, 16], [41, 54]]
    >
    >
    > boxLeft = charPosToLoc(member,"Glossary" hl[3][1]) -- 3rd link
    >
    > This basic code could get the start and end char of hyperlinks, just
    > need to guess or get the line height the establish line height, and
    > maybe get position of char after link end to establich box right
    <snip>

    Thanks for this, JB, am experimenting with charPosToLoc.

    h


    h Guest

  8. #7

    Default Re: How to find rects of hyperlinks within a block of text?

    Rob Dillon <rob@ddg-designs.com> wrote:
    > If you're working with that much content then you might want to
    > consider using Flash .swf files for each of the text members. You can
    > set all of your hyperlinks right in the flash file.
    I've tried a few experiments with Flash but it just can't handle the
    shifting of big bitmaps. We need to be able to scroll long (i.e. several
    screens' worth) chunks of rich text and images for our projects, in windows
    around 550-600px square. Neither Flash nor Director will let me do that
    smoothly, but we're faced with clients and users who are used to
    web-browsers routinely and effortlessly scrolling through enormous chunks of
    really rich media in web-pages... hence imaging lingo and an attempt to
    reproduce some standard UI things with new speedier behaviours.

    [rant]
    Most of our work with Director seems to involve displaying (and/or printing)
    documents at some point or another. To have to fall back to PDFs and an
    external program not under projector control is painful...
    [/rant]

    In the absence (AFAIK..?) of robust cross-platform HTML or PDF solutions for
    Director, am still pursuing JB's charPosToLoc suggestion :)

    Many thanks,

    h


    h Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139