14 Replies Latest reply on Jun 27, 2006 10:03 PM by airpolgas

    text link behavior

      I was handed a working flash site. The previous guy who maintained it left the company. He had some links that Flash says are "buttons." I was asked to change the text of the link, so I went in with Flash 8, drilled down to the text of the link, then changed it. When I published it, the "empty sace" of the text does not activate the hover behavior, like changing the color. The link is only active when the mouse is hovering on the actual letters, not the space in between letters, not the space in the letters like "e" or "o" or "p"

      Can someone point me to the right direction on this? I want the whole word(s) to be an entire button.

        • 1. Re: text link behavior
          If this was working prior to you altering it, it's probably best to go back and see how it was done before and replicate that.

          There are a few ways this may have been done. One is to place a button over the text you wish to link that just has a 'hit state', and apply the link code to that. The better way would be to make the text field an htmlText field, and applying a link as you would an html document. This will eliminate the 'holes' in the link that macromedia/adobe has never fixed by using flash's 'link' feature.
          • 2. Re: text link behavior
            airpolgas Level 1
            Thanks. This is all greek to me.. for now, but I'll play with those suggestions. For what it's worth, I only did a search and replace for the text I changed.
            • 3. Re: text link behavior
              Craig Grummitt Level 3
              have you have checked the hit state of the button/s?
              • 4. Re: text link behavior
                Or the really easy way instead of those complicated (and not necessarily the best) solution is to simply make an invisible rectangle behind your static text field. The reason flash does this is because Flash' hit detection only looks for what parts of the movieclip are 'visible'. Meaning, if there is empty space in a movieclip then it is not considered clickable, even though the movieclips overall width and height may include this area. If it did make an entire movieclip active based on its size as you see it in the stage then there would be no way to do curved or other interesting shapes as buttons ;)
                • 5. Re: text link behavior
                  squipple Level 1
                  I stand corrected. I found that flash's link feature does not yield the gap issue I had mentioned before. What the links must be set up as is buttons without a hit state. In which case, caskater's solution would be best. Add a rectangle in the hit state behind the text.
                  • 6. Re: text link behavior
                    airpolgas Level 1
                    Thank you all. I tried the rectangle behind the text. Works like a charm.
                    • 7. Re: text link behavior
                      I cant get text made in actionscript with the CreateTextField to behave this way in flash 8. Can anyone tell me how to make it behave so the events only trigger when rolling over the actual letter as this post describes? (yeah i'm trying to do the opposite)

                      • 8. text link behavior
                        Craig Grummitt Level 3
                        now you mention it franzmaruna, i was a little curious about that in airpolgas' issue.
                        with static text, flash 8 uses the textfield area as the rollover area while flash mx 2004 uses the vectors of the characters themselves. so maybe airpolgas should check that he/she's exporting to flash 8 player.

                        if you do have the unusual request of wanting the rollover to be the vectors of the characters themselves, you could either export for flash 7, or break apart your text box. however both of these solutions assume a static text box, and in answer to your query though franzmaruna, i'm afraid dynamic text boxes like you're using use the whole text box area as the rollover.
                        there'd be a way to do it dynamically, but i think it would be a bit of work and how to go about it(and whether it would be worth it) would depend on the specific needs of your project.
                        • 9. Re: text link behavior
                          airpolgas Level 1
                          There came a point when I was editing the movie that I had to create an email link from scratch. When i made it, the behavior was OK for the entire text area. I still can't figure out how when I changed the old link, why it does the vector thing. If it's any help, the link I am having a problem with is not actually linking to an external page or an email address, it just directs the movie to display a different scene in the main body of the page. I also believe that the original FLA file was created prior to Flash MX.
                          • 10. Re: text link behavior
                            Craig Grummitt Level 3
                            have you checked that you are exporting to flash 8 in your publish settings?
                            or are you satisfied with your solution of hit state/ invisible rectangle etc anyway?
                            • 11. Re: text link behavior
                              airpolgas Level 1
                              I did not check or change anything on the publish setings, so it may have defaulted to Flash 8. I really am not putting much effort into the link at this point because most of the editing I've been doing in the past few days are more aimed at changing certain dates (it's for an online class). For now the rectangle solution works for me. Thanks.
                              • 12. Re: text link behavior
                                franzmaruna Level 1
                                way to be enticingly illusive..

                                What are you thinking would be the way?

                                Only ways i can imagine are pretty far outta the box at this point (da-dum-dum).

                                I could see creating the text by cycling through an array for each character and building the label by creating invidual clips for each letter.. fantastic... specially if i have to do upper case.. thanks adobe for the feature improvement.. ;)

                                or... i could see trapping mouse events and building collision detection.. which i'm none-to-thrilled about as this is a detail zoom view to an app that has a fair amount of rollover type events already going on.. that just sounds like a mess waiting to happen.. and what if i have letter forms that overlap - how painfull will my collision detection get with choosing based on z index and whatnot... oi..

                                any thoughts?


                                if yer interested, here's the prototype of the app. Click one of the small hex images once they load. You'll see a bunch of text tags on the left in the detail view. that's the problem.

                                my protoye
                                • 13. Re: text link behavior
                                  Craig Grummitt Level 3
                                  your first out of the box option was exactly the one i had in mind - creating your font symbols manually and setting up a custom textbox class to display your text. a lot of work huh?

                                  i don't think this is an issue with adobe's feature improvement of static text though is it? you're talking about dynamic text right? i don't think you've ever been able to click on the character vectors in dynamic text boxes.

                                  if this IS static text, then it might increase your file size, but it might be worth just breaking apart the text as it is. of course doing this depends on your project - the amount of text we're talking about, the need to keep file size down, the amount of time you are willing to contribute to the project etc etc.
                                  • 14. Re: text link behavior
                                    airpolgas Level 1
                                    franz, in case you were referring to my post, I'm not being elusive. :) Sorry if my reply appears that way.

                                    From the looks of it, you are way, way, way ahead of me in flash (nice prototype), I wish I were already at that stage.