Hi everyone.I found a very usefull tool with which someone can turn a normal text field
to a hyperlinked like environment.
Where you can click and triger handlers.

If you have time and want to understand more about the tool and how it does
it here is a descriptive explanation:
IF NOT JUST JUMP AT THE END WHERE MY QUESTION IS

------------------------------------------------------------------------
---------------------------------------------------
------------------------------------
--------------------------
----------------
---instructions

1. Run the "hyperlink" movie. It appears to work on director 5.0, Mac and
PC. Coloring of hyperlinks 
doesn't work in director 4.0, which is totally not my fault.

2. Copy the source text into the blue box at the top.

3. Mark up the source text with hml-like anchor tags. The html anchor tag
looks like this 
<a href=[page address]>link</a>. Use the same tag, except instead of using
the "href" attribute, 
simply add a line of director code.

    <a [director command...]>link</a>

Everything after the "a" will be exectuted using the Lingo "do" command, so
there can't be any quotation 
marks in there EXCEPT for things like "go to "this marker"". In this case,
note that the " gets translated 
into the QUOTE symbol in the anchor list. Also, you really want to keep your
command to one line of code, 
and no hard returns either, or you'll get an error. For more complex things,
put them in a seperate handler 
and call the handler from the anchor tag.

The tags shown here are examples.

    do <a nothing>nothing</a>. 
    <a put the mouseH>show me the horizontal position of the
         mouse please</a>
    <a go to "this marker">"go to "this marker""</a>
    <a beep 2>beep at the user</a>
    <a doThatThing (this, that)>call a handler</a>
    <a Fileio(mDescribe)>more complex things</a>, 

You can have as many tags as you want, although for large (>50?) numbers of
links you may suffer 
a speed hit (haven't tested this, but it could happen). In this case see
below for how to break the 
text into more than one castmember. 

4. Press the "parse" button. This will read in the source text, and spit out
a castmember caller 
"display text" in the yellow box below. The display text will have
associated with it a castmember 
called "anchor list", which contains the hyperlinking information for that
text. At run time, 
you need only three castmembers: "display text", "anchor list" and
"hyperlink code" to make the text 
act like it is hyperlinked.
Note that "parse" will not change your original "source text" at all.
Note2: Unfortunately, "parse" does not keep text style changes in "source
text" at the moment. 
This could be added fairly easily now that director supports
character-by-character text style assignment.

5.  Test your mark-up by clicking in the "display text" (with the movie
still running). 
When you hit a character which has been correctly marked up, the code
associated with the text will be executed. 
You can assure yourself of this fact by checking the message window; every
time you click on hyperlinked text, 
it will print "executing " and the lingocommand.

    "executing: doThatThing (this, that)"

You can continue to edit your source text and re-parse it as much as you'd
like. Parse will replace the text 
in display text each time.

6. When you have the text marked up like you want it, parse one last time,
and stop the movie.

7. You can now copy the cast members "display text", "anchor list"  and
"hyperlink code" into the cast of your own movie. 
These are the only members you need to make your text work at run time. You
do not need the "parse" code unless you want 
to give your users the ability to make their own links. Alternatively you
can save this movie as a different name and 
delete all other castmembers.

8. That's it! Place the "display text" castmember on the stage wherever you
want it. When you run the movie, 
that castmember should be click-sensetive. Enjoy safe, soluble code!

>8. If you want to have more than one hyperlinked castmember in your movie
you will need to rename "display text" 
and "anchor list" so that "hyperlink code" knows which anchor list to
associate with which display text. 
When you do this, simultaneously change the script of display text" to say
          hyperlink (the mousechar, "xxx")
where xxx is the new name of the "anchor list" cast member. For example you
could...

   a) rename "display text" to "introduction text"
   b) change the cast script of "introduction text" to
          on mousedown
            hyperlink(the mousechar, "intro alist")
          end
   c) rename "anchor list" to "intro alist"

No matter how many hyperlinked text members you have, you only need one copy
of the "hyperlink code" castmember 
in your movie.
This tool called hyperlink was created in 1997 with Director 5.0
Is there such a functionality functionality in the 
-----------------------------------------------------------------------
-----------------------------------------------------------------------
------------------------------------------------------------------------

IS THERE ANY EASIER WAY FOR SOMEONE TO DO THAT IN DIRECTOR 8.0 ?
I MEAN TO PRODUCE A TEXT FIELD WHITH SUCH FUNCTIONALITIES WITHOUT THE TOOL

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to