mouseword (flash question)

  • Started
  • Last post
  • 3 Responses
  • jkosoy

    hullo all developers,

    a flash question for you:

    we're trying to create a 'glossary bubble'. as the user reads through the text onscreen, certain words are highlighted. when the user rolls over one of these words, a text bubble appears with more information about it.

    the trick is that we have a TON of content, so all of our text is dynamically drawn from xml files. what we need to do is:

    a) figure out which word the user is rolling over

    b) determine if that word is in the glossary

    c) make the bubble with the appropriate information pop up.

    i've created something similar in the past using director's mouseword command. (http://www.developerdispatch.co... to see what mouseword does).

    does anyone know of any sort of similar command for flash? perhaps a component or some code or something?

    thanks all. :D

  • jkosoy0

    http://www.developerdispatch.com…

    i think i mighta broke the link by accident...

  • SmilingBuddh0

    2 thoughts, both of them a pain in the ass:

    1) Write an engine to build your text word-by word as movie clips. Assign any 'hot' movie clip a onRollOver event to trigger your bubble

    2) Use a monotype font and write some code to figure out where the mouse is in relation to the textbox _x and _y. Then calculate the word from that. Or, place blank clips on top of the box, as above.

    There may be an easier way to do this, but my brain hurts.

  • beingdevious0

    yes yes, XML and flash..

    your going to be dynamically generating the text from the XML file, well when each word from the xml is parsed check if its in the glossary. iwrite a function if it is, and use that to create a blank_mc the width of the word.. gonna have to use monotype though.. instance the name of the blank_mc like "word_1" and attach a onRollover to it. now, the tricky part is the info in the bubble.. use the blank_mc's instance name to link to the glossary item. "word_1" is something like ... "dog" in the glossary, or even instance the name exactly like the item.. dog=dog. so when the popup is called, it checks the glossary, im assuming its XML too.. and uses the insantce name of its blank_mc to check it.

    hope that helps