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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Flash - Open image link in new window 1

Status
Not open for further replies.

bktrent

IS-IT--Management
Sep 17, 2009
2
US
Hello,
I'm modifying a Flash website that parses content from an xml file. The Flash site is built using Actionscript 2 and it was built by a developer that is not around to assist.

Part of the Flash site includes a pair of images and associated text. Both the images and the text need to link to external web pages, and they need to open in a new window. I am able to get the text link to open in a new window, but not the image links. I could certainly use your help as I've been working on this for quite some time with no luck.

Here's the xml code I have:

<image imageUrl="_yelpLogo.png" link="yelpPudding.html" target="_blank"/>

<![CDATA[<font size="14" color="#2e2e2e"><u><a href="yelpPudding.html" target="_blank">Check out our profile on Yelp!</a></u></font>]]>

The target="_blank" portion of the imageURL link doesn't do anything. It just opens in the same window. Clearly this is not correct. However, the target="_blank" portion of the image link works fine since it is in the CDATA brackets. I did attempt to rewrite the image link in html format <a href="index.html" target="_blank"><img src="image.jpg" width="" height=""/></a>. That did not work as it is not supported by the parsing code apparently.

Can anyone help or point me in the right direction?

Thank you.
 
[1] The general plan of the transformation (with actionscript) would be to make the image tag in the xml document:

[tt] <image imageUrl="_yelpLogo.png" link="yelpPudding.html" target="_blank"/>[/tt]

to html anchor of the following form:

[tt] <a href="{@link}" target="{@target}"><img src="{@imageUrl}" alt="{@imageUrl}" /></a>[/tt]

where I suppose the <image> is the context node and that {@link} is meant for the evaluation of the link attribute value of the context node etc...

[2] For detail and focused flash specific and action script setup, I would suggest you bring the question to our flash forum for better advice from members there.
 
Thanks for the reply. I've tried what you suggested already, but for whatever reason the Flash program won't recognize it. The image just comes up blank when it's parsed. I will check out the flash forum that you suggested to see if I have luck there. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top