ActiveDen

htmlText combining img and href tags

3860 posts
  • Has been a member for 5-6 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
  • Author had a Free File of the Month
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 100 and 499 items
  • United Kingdom
  • Referred between 200 and 499 users
flashjunkie says

Hey guys,

Some help if you have found the solution to this…

im loading html formated text into a htmltext field, and i am loading in an image, but i cant get the image to work as a link.

Sample Code:


textfield_txt.htmlText = "<a href="LINK"><img src="SRC" /></a>" 

that isnt the exact code i am using as i am loading the data from xml, but it is the same thing.

When you rollover the image the hand cursor appears but on click nothing happens.

Help pleaaaaaaaaaaaase! :?

Jay

3 years ago
1092 posts
  • Has been a member for 5-6 years
  • Won a Competition
  • Contributed a Blog Post
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Netherlands
  • Referred between 100 and 199 users
jurgenv says

Dunno.. never tried. If you separate the link from the image (e.g. just make a text link) does it work then? If it does then I think the Flash html engine is not advanced enough for your wishes :)

3 years ago
2309 posts
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Beta Tester
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
  • United States
  • Referred between 10 and 49 users
theflyingtinman says
When you rollover the image the hand cursor appears but on click nothing happens.

Help pleaaaaaaaaaaaase! :?

Jay

I just threw together a quick test and at first got the opposite result. The image didn’t appear but when I clicked the area where the image should have been (hand cursor appeared) it navigated to the link :) I discovered that the image would only appear if there was some text preceding the anchor tag in the string assigned to the htmlText property. (and it still navigated to the link correctly)

3 years ago
32 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
  • United States
AnthonyRiccio says

why not just use a loader?

example :

var lv:LoadVars = new LoadVars(); lv.onData = function(content) { textfield_txt.htmlText = content; } lv.load("test.html");

The test html looks like this

test.html :

<html> <a href="www.flashden.net"><img src="href=\"http://www.flashden.net/files/84851.png1235228978" /></a> </html>
3 years ago
3860 posts
  • Has been a member for 5-6 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
  • Author had a Free File of the Month
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 100 and 499 items
  • United Kingdom
  • Referred between 200 and 499 users
flashjunkie says
When you rollover the image the hand cursor appears but on click nothing happens.

Help pleaaaaaaaaaaaase! :?

Jay

I just threw together a quick test and at first got the opposite result. The image didn’t appear but when I clicked the area where the image should have been (hand cursor appeared) it navigated to the link :) I discovered that the image would only appear if there was some text preceding the anchor tag in the string assigned to the htmlText property. (and it still navigated to the link correctly)

There is text preceding it, but it doesnt work :(

its not a mega important feature but i thought it would be a nice touch, never mind… :(

3 years ago
2309 posts
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Beta Tester
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
  • United States
  • Referred between 10 and 49 users
theflyingtinman says
its not a mega important feature but i thought it would be a nice touch, never mind… :(

If you still want to make a link on the image you could get a MovieClip reference to it using: TextField:getImageReference(id:String) then just add a regular mouse event listener on the image MovieClip. You could even give it a rollOver effect using the mc reference.

3 years ago
32 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
  • United States
AnthonyRiccio says

no one ever listens to me

3 years ago
4243 posts
  • Has been a member for 3-4 years
  • Contributed a Blog Post
  • Attended a Community Meetup
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
Aw_Shucks says
no one ever listens to me

Yo, would that be within an actual HTML page. Or from within a xml file using CDATA ?

3 years ago
32 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
  • United States
AnthonyRiccio says
no one ever listens to me
Yo, would that be within an actual HTML page. Or from within a xml file using CDATA ?

That would be within a html page, of course you could use xml the same with CDATA .

Thanks for responding to me :)
3 years ago
by
by
by
by
by