Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rollover HTML links in flash

Status
Not open for further replies.

bentleykf

Programmer
Apr 29, 2002
59
AU
i have a dynamic text field which has HTML href's in them. Is it possible for flash to change the style of these text links onMouseOver and onClick like the links on this page????
-bentley k. frog
 
i dont know if this can be done or not..would certainly require a javascript call....and wont be done easily

you could always try



there are quite a few useful pieces of javascript there and you might find a possible direction to explore. if you do find a solution let me know..this would be a neat function to add to my collection.
 
ok, thanks bill
i think i know how to do it.....maybe
i just need to know how to access substrings within dynamic text fields???
and perform actionscript functions when dynamic text has the mouse over it???
sorry, i'm a newbie to actionscript :(
 
upon reading the article its not as promising as i had thought.
i have been down that road and while i can change ALL the text in the box I so far cant simply change the color of the link.
ah well ....I shall keep trying
 
I have been down that road also using the asfunction, and the problem is not changing the color of any given word or part of sentence in the text (that I've easily managed... Like in some combobox example I did a while ago!), but when reloading the altered text in the textfield, all the text following the first use of the asfunction, now becomes a "link" and not just the altered word of part of sentence as it used to be...

Also still working on it... In my spare time! Regards,

oldman3.gif
 
mind if i have a look at what you guys r doin, could you send me some .fla files??????
 
this was my first approach but when i developed it to load text from the text file all the text changed color and i abandoned the approach which was basically create a text field inside a movie clip. anyway my starting point was this.

fmtNav = new TextFormat();
fmtNav.url = "fmtNav.bold = true;

this.createEmptyMovieClip("nav", 101);
this.nav.createTextField("link1", 1,-200,25,163,19);
with (this.nav.link1) {
border = true;
text = "button1";
textColor = 0xFF0000;
html = true;
setTextFormat(fmtNav);
}
this.nav.onRollOver = function() {
this.link1.textColor = 0x3366ff;
}
this.nav.onRollOut = function() {
this.link1.textColor = 0xff0000;
}

maybe you can go in another direction so i have left as is and not shown where i went so as to not blind side you.

............................

second approach to search and replace the link text format

String.prototype.replace = function(srch_str, repl_str) {
return this.split(srch_str).join(repl_str);
};

x_str = '<font color = &quot;#990000&quot;>';
x_str.replace('<font color = &quot;#990000&quot;>', '<font color = &quot;#000099&quot;>');

just started this one and not had the time so far to go further. the search and replace bit works fine with text and ought to work with htmltext.
my plan was to copy the contents of the text field into a variable, empty the text box, search and replace with variable, then reload the text.

im kind of busy at the moment so i wont have time to look at it. i think this approach has more promise than the first.
why not try to run with it bentlekyf, and see if leads anywhere
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top