|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm looking for a way to make hyperlinks in dynamic textfields (rendered as html) change color onmouseover. Is that possible?
// Johan |
|
#2
|
|||
|
|||
|
One way of doing this is to place an invisible button ontop of your dynamic text. The button then responds to the mouse by manipulating the text field. Bellow is some code I recently used to do just this. It creates the text and button on the fly within flass. It assumes you have a movie clip symbol with a square in it, have already created a textFormat object.
This code will start your text black and on rollover make it white w/ a black background. color1 = 0x000000; color2 = 0xffffff; // create your text and button objects createTextField("words",1,0,0,0,0); attachMovie("invisi", "button",2); // set the text words.text = "some text"; // set text colors words.textColor = color1; words.background = false; words.backgroundColor = color1; // set text formating words.setTextFormat(_global.plainformat); // set the text height and width. (necessary to make it visible since it was created with // a height and widht of 0 words._height = 1.2*words.textHeight; words._width = words.textWidth+5; // set button x and y, width and height to that of the text button._x = words._x; button._y = words._y; button._height = words._height; button._width = words._width; // make button invisible button._alpha = 0; // add a variable to button which points to the text object button.affect = words; // make button actions button.onRollOver = function() { this.affect.background = true; this.affect.textColor = color2; } button.onRollOut = function() { this.affect.background = false; this.affect.textColor = color1; } button.onPress = function () { getUrl("http://yourUrlhere"); } |
|
#3
|
|||
|
|||
|
It's hard when you don''t know where the links will be.
I found a way to do it with traditional CSS, apparently flash has got support for a:hover and stuff ![]() Thanks anyways |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Onmouseover on dynamic text? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|