Can't use image as link using asfunction for some reason

I have a pretty large which was coded using AS2 in about 2006 so I'm trying to make a few changes using AS2 which I'm pretty rusty on.  I have a swf which loads an xml file into a textarea in flash and it all works well.  I have to link some images which appear in the xml file but those images have to be links to external sites and that is where I am running into problems with my asfunction.  Here is the code.
Function in my AS:
function launchSite(arg) {
  if(arg == "agri") {
    getURL("http://www.usda.gov/wps/portal/usdahome", "_blank");
then of course arg will take different values for the other links:
In the xml file, here is the asfunction code:
<a href='asfunction:_root.launchSite,agri'><img src="images/agri.gif"></a>
What is happening is the function is working and the external link is opening in a new browser window, but the xml stops at that point so most of the agri.gif image and the rest of the page are gone.  If I change the img tag to just a text link, then all is well .. but my client wants the images to be the link.
To further complicate, if I remove the link text and have only the img tag, the page is fine.  They just won't work together for some reason.  Any thoughts?
Thanks!
Nancy

>the cdata tag is needed so you can load the xml that contains html tags.
Interesting since my xml files are full of html tags and everything else renders just fine without CDATA tags.  My textarea is configured to allow HTML.
AS as follows:
//set up the textarea
//init TextArea component
myText.html = true;
myText.wordWrap = true;
myText.multiline = true;
myText.label.condenseWhite=true;
//set up the XML
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("xml/acts.xml");
myXML.onLoad = function(success)
var myArray:Array = myXML.firstChild.childNodes;
myTitle.text = myXML.firstChild.attributes.title
myLoader.contentPath = myXML.firstChild.nextSibling.attributes.src
myText.text = myXML.firstChild.nextSibling.nextSibling
function loadFunction(target){
myXML.load(target);
myXML.onLoad = function(success)
var myArray:Array = myXML.firstChild.childNodes;
myTitle.text = myXML.firstChild.attributes.title
myLoader.contentPath = myXML.firstChild.nextSibling.attributes.src
myText.text = myXML.firstChild.nextSibling.nextSibling
//function to load the external XML
function launchSite(arg) {
  if(arg == "agri") {
    getURL("http://www.usda.gov/wps/portal/usdahome", "_blank");
pertinent part of the xml as follows (portion of the text node which displays all the text):
<a href='asfunction:_root.launchSite,agri'><![CDATA[<img src="images/agriculture.gif">]]></a> Department of Agriculture:  The Department of Agriculture began in 1862.  The main job of this department is to keep our food is safe and healthy.  They also work with farmers if they need help selling their crops both in the US and around the world.  Secretary of Agriculture is Mr. Thomas J. Vilsack.
I added the CDATA tags at your suggestion.  What that gives me in the browser is a working function (loads the external site in a new window as desired) but instead of the image, I have the img tag printed out due to the CDATA tags (which by definition is not parsed).
I have had pages on pages like this in this site since 2006 (which is why it's done in AS2 and not 3) and have never had a problem until the client wanted the images to be links to the external sites.  If I put in the image tag without the link, it works.  If I put in the link tag with a text link rather than the image, it works.  It's the two together that do not work.
Does that make sense?
Thanks again!
Nancy
  after that you need to parse the xml correctly and assign to your textarea.  are you?

Similar Messages

  • I own an iPod Classic.  In iTunes, some podcast videos cant be played on teh iPod, so I set it to convert the video to the right format for the iPod.  It used to work perfectly, but now for some reason, it doesnt convert properly!  When I play the video,

    I own an iPod Classic.  In iTunes, some podcast videos cant be played on teh iPod, so I set it to convert the video to the right format for the iPod.  It used to work perfectly, but now for some reason, it doesnt convert properly!  When I play the video, it is just a white screen, but the sound can be heard.  Can anyone help??????

    Your source video file is probably muxed.
    Neither QT Pro or iTunes has the ability to successfully encode a muxed video file with audio. You'll end up with video and no audio.
    See: iPod plays video but not audio of some exported files.
    You'll need to use some other third-party software to do the conversion. There's a handful of software available. Just search the forums and you'll find many titles mentioned.
    Try MPEG Streamclip.

  • HT1277 I can send & receive email from my ipad but for some reason I can no longer do this from my i mac.It keeps telling me that the password is not valid with the imap server.I keep entering the password but it won't accept it.

    I can send & receive email from my ipad but for some reason I can no longer do this from my i mac.It keeps telling me that the password is not valid with the imap server.I keep entering the password but it won't accept it.

    Do you have one, two or more entries in the left colum of Mail.app for your mail server(s)?  That is, do you have your Mail.app set up with either a btinternet entry, with a btyahoo entry, or both?  Or more?
    I'm guessing that you might have one account (btyahoo?) listed for incoming (IMAP server) mail, and with the outbound (SMTP server) mail is configured and named btinternet.
    Based on what little I see posted, it looks like BT uses both btinternet and btyahoo, but I'm not exactly clear on how they have their stuff set up, and their web set gets helpful and tries to help configure my mail — I don't immediately see a single web page with the mail server set-up details.  The BT email client set-up starts here.

  • I am at present in Spain. I have OS 10.6.8 on my applepro laptop. How can I upgradeto Mountain Lion? I can't get on to the apple store, for some reason.

    I am at present in Spain. I have OS 10.6.8 on my applepro laptop. How can I upgrade to Mountain Lion? (and then to Mavericks). I can't get on to the apple store, for some reason.

    Open the App Store application and use it to download Mavericks.
    No need to get Mountain Lion first.

  • Can anyone help me - when I open itunes for some reason TV shows does not appear anymore?

    Can anyone help me - when I open itunes for some reason TV shows no longer appears?

    Go to iTunes prefs>General - make sure the box is ticked for TV Shows.
    MJ

  • HT4718 I have OS 10.6 Tiger and I use to have DAshBoard and now for some reason I can not find it to launch it.  Can anyone help me??

    For some reason I can not launch Dash board anymore.  I have used Finder and it is not there.  What can I co besides take computer into service?

    1. It's possible you removed Dashboard from your Dock by mistake. In that case, you can find it in your Applications folder and drag it back to the Dock to create the alias. The entire Dock are aliases.
    2. If you cannot find in your Applications folder you can try re-installing the Combo Update I linked to.
    This is a fuller install, as opposed to an incremental "delta" update so it should overwrite any files that are damaged or missing. It does not matter if you have applied it before.

  • Need to be able to use and sinc Google calendar, I can not get enhanced google email plug in for some reason

    I finally got a gmail account and have tried to create a calendar for my family using google calendar.  The calendar appears on my Torch 9810 but will not sinc with google calendar.  I keep reading that I need enhanced google mail plug in but can not find where to get this plug in.  I am not tech savy, so any help would be appreciated.  I am a long time Blackberry customer (15 years) and in the almost 2 years of having the Torch, I am ready to huck it out the window and give up.  I loved my Bold, the Torch does not compare in my ease of use.
    Thank you for your help.

    Hi and Welcome to the Community!
    From what I understand, Google discontinued support for the Enhanced PlugIn as well as many other things...but that's a change that Google made, not BlackBerry. Further, via the available OTA sync capability for Google Calendar, only the primary calendar can be synchronized...no others.
    So, I'm a bit unclear about your specifics...it sounds like you created (on Google) a sub-calendar for "family", and somehow got that to appear on your BB, but cannot get it to sync OTA with Google. But all of that sounds contradictory to what I understand...in that you should not have been able to get that sub-calendar to appear on your BB at all since Google only supports the primary calendar.
    So some further details about all of that will likely help greatly in understanding, and hopefully then providing you with useful guidance.
    Thanks and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I just bought a MG5420 printer to use with my macbook pro, and for some reason my laptop only detect

    I just bought the MG5420 to use for my macbook pro, and my laptop only detects it as a scanner. I installed the included set up CD but can't get printer to work/connect with my macbook.  how do i get the mac to recognize the printer?  

    Hi chinesechecker ,
    To ensure the most accurate information is provided, please let us know if you are using your printer through the USB connection, or through the wireless setup.  Also, please let us know the specific version of Mac you have (ex. 10.5, 10.6, 10.7, etc).
    If this is a time-sensitive matter, additional support options are available through the link below:
    http://www.usa.canon.com/cusa/consumer/standard_display/contact_us_consumer
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • HT1386 HI I need help, I just purchased my first Ipad I have an i phone, ipods for kids and a mac computer.  all of them show in my itunes account I can sinc music, blah blah, manage devices.  for some reason when I plug my ipad in it doesn't sync how can

    I am wandering why my new ipad doesn't show up in my itunes account, manage devices, that sort of thing, can't set it to sync.  it obviously is set up somehow I can get all of my apps and it has my music but I want to be able to sync playlists and stuff like that????

    Hi stayreckless88,
    If you are having issues with your iOS devices not showing up in iTunes on your new computer, you may find one of the following articles helpful:
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/ts1591
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/ts1538
    Regards,
    - Brenden

  • I purchased Red2 on my Apple TV but it's not playing. I can watch Netflix and anything on Apple TV, for some reason, can't see this movie. Please advise.

    I purchased Red2 on my Apple TV in the UK and it's not playing.  I received a £4.99 bill from Apple so need to make sure I can at least watch the movie. Please advise.

    What happens when you attempt to play it? Is there an error?

  • TS3276 I can access email from icloud on mobileme but for some reason my mail icon on my IMAC doesn't pick up or send my emails anymore?

    Recently, my email from my IMAC starting asking me for my Password.  It won't accept my PW however, I can go to Icloud and check my email that way (with same password info).  Does anyone have any ideas of how I can resolve as I would prefer to check email from the Mail icon on my homescreen???

    Start with the connection doctor, and see if that reports errors.
    Mail.app Window > Connection Doctor
    The password-prompting requests can also be triggered by a network problem; confirm your network is working.

  • I can't import enums for some reason

    In a class I made, I can't seem to import an enum. Eclipse tells me "The import de.game.ground.Constants.Board cannot be resolved." Board is the name of my enum sitting in the class Constants.
    What's so weird is that other classes have imported the enum and are using it just fine. But for some reason this one class won't. These classes are all in the same packet. What's up with that? It makes no sense to me that other classes can import it, but I get an error message trying to import it to this class.
    After some googling, I tried adding import java.util.*, even though the other classes didn't need it, but that didn't seem to make a difference. I also made sure my "compiler compliance" is set to 1.6. I can't think of anything else to try.

    codinatrix wrote:
    There is no code. The problem is with an import. The code in its entirety would be:
    ...Of course there is! The entire contents of a .java file is source code.
    Here's an example of an SSCCE:
    test/Constants.java:
    package test;
    public class Constants {
        enum Board { A, B, C }
    }And a small driver class to test it, test/Main.java:
    package test;
    import test.Constants.Board;
    public class Main {
        public static void main(String[] args){
            Board b = Board.B;
            System.out.println(b);
    }Both classes compile just fine and when I run the Main class, 'B' is printed to the console. No errors.
    See what I mean with SSCCE: you can copy, paste and compile my code without altering any of it.

  • I just noticed that I can no longer select photos out of my finder that are located in my Aperture/Iphoto Library.  I used to be able to attach photos to my gmail out of the aperture library in the finder and for some reason, no longer can.

    I just noticed that I can no longer select photos out of my finder that are located in my Aperture/Iphoto Library.  I used to be able to attach photos to my gmail out of the aperture library in the finder and for some reason, no longer can.
    I can't access these images except to go into the applications. 
    Also, I'd like to import my iphoto library into aperture, and move aperture library to an external drive.  I tried the import first, but there wasn't enough space.  Then I tried copying over the aperture library onto the external drive but it failed bc it said file was in use. 
    As it is, I only have 50gb left on my imac, and the aperture library is 150gb.  Also, I have over 10k images in both libraries combined and there are tons of duplicates that need to be sorted, and hopefully not messed up because I've organized most of them.
    So in short, I need to know how to do the following:
    -select photos in finder in aperture/iphoto libraries
    -move aperture library to live on external drive
    -import iphoto library into aperture library
    -eliminate dups but maintain organization
    -moving forward i need a better workflow so that I import images from camera, and can organize right away into albums rather than creating projects by default and then creating albums so essentially the photos are in 2 different places, even tho they are referenced
    -live happily ever after
    Thanks in advance for any support you can offer!!

    If you're using apps like iPhoto or Aperture then they replace the Finder for managing your photos. The point is that you use the (many) options available via these apps for the things you want and need to do with the Photos.
    So, simply, you don't select the photos in the Finder. I'll append the supported ways to do this - which are faster and will yield the current version of your Photos - to the end of this post.
    -move aperture library to live on external drive
    Managed or Referenced Library? Managed -
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit Aperture
    2. Copy the Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching Aperture. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Referenced -  relocate your Masters first.
    These issues are covered in the Manual and on this forum hundreds of times.
    -import iphoto library into aperture library
    FIle -> Import -> iPhoto Library? Have you done this already? If so are you trying to move the Masters to Aperture from an  iPhoto Library? Or Consolidate them?
    -moving forward i need a better workflow so that I import images from camera, and can organize right away into albums rather than creating projects by default and then creating albums so essentially the photos are in 2 different places, even tho they are referenced
    You can't. Every photo is in a Project.  They’re the basic building blocks of the Library.
    You might want to spend a little time with the manual or the video tutorials. I'm not sure you've grasped the app  you've purchased.
    The following is written for iPhoto, but about 97% works for Aperture too.
    There are many, many ways to access your files in iPhoto/ APerture:   You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics. This is what you use to attach your shot to your GMail
    (Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)
    You can access the Library from the New Message Window in Mail:
    There's a similar option in Outlook and many, many other apps.  If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto/ Aperture.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    If you want to access the files with iPhoto/ Aperture not running:
    For users of 10.6 and later:  You can download a free Services component from MacOSXAutomation  which will give you access to the Library from your Services Menu.
    Using the Services Preference Pane you can even create a keyboard shortcut for it.
    or use this free utility Karelia iMedia Browser

  • I have been backing up iMovie 08 files to my external drive, but for some reason I can't open these files in iMovie.  I used drag and drop to copy them.

    I have been backing up iMovie 08 files to my external drive, but for some reason I can't open these files in iMovie.  I used drag and drop to copy them.

    You really should be doing backups with an actual backup application, especially one that will work automatically, and, if your external HD is large enough, back up your entire system.  These can automatically back up only what's changed since the  previous backup, and some will keep "archive" copies of things you've changed or deleted, also.
    Too many things can go wrong, such as your internal HD failing, and you'll have a major project to reinstall everything.
    You already have Time Machine, built-in to OSX.  You might want to review the Time Machine Tutorial, and perhaps browse Time Machine - Frequently Asked Questions.
    #27 in the second link mentions some alternatives, too.

  • This may sound stupid but for some reason I can no longer use the return button after typing in a url to go to that site. Does anyone know how to fix this?

    For some reason this stopped working on firefox a week or so ago. I have tried to uninstall and install firefox again but the problem still persists. I've tried both chrome and explorer and they don't seem to have this problem.
    I'd hate to stop using firefox but this so annoying that in less i can fix it, i'll have to change my browser!

    Hi larryhall,
    I'd try starting Firefox in [[Safe Mode]]. If you don't have the issue while all of your add-ons, extensions, and themes are disabled, you can try adding them back in one by one until you find the culprit. You should look at the [https://support.mozilla.org/en-US/kb/Troubleshooting-extensions-themes Extensions and Themes troubleshooting guide ] and the [[Troubleshooting plugins]] article as well.
    Hopefully this helps!

Maybe you are looking for

  • How to delete more than one picture at one time in iMovie?

    In the timeline, can I delete more than one picture at one time, or do I have to right click and choose delete entire clip for each picture? I tried to select one (so that there's a yellow bracket) and then shift and choose the last picture (so all a

  • How to use 2 GL for loss made on asset retirement w/o revenue ?

    how to use 2 GL for loss made on asset retirement w/o revenue. hello everyone i have some trouble. my company want to use 2 GL account for asset retirement example  some time use GL 6500001  some time use 6500002 in standard configuration AO90 , fiel

  • Email Notification Syntax Error

    I'm having trouble getting Email Notification working using Motion Detection with WebCam Centre. Updated to .7.02 but still not working. The problem seems to be the SMTP server setting. When I try and send the test email I get this syntax error: Synt

  • Projects and Job Management Evaluation

    I am currently evaluating B1 to see how it will handle Job Costing and processing.  We are a trading company that wants to know sales/costs/margin, actual vs budget on each deal we do.  These are not large construction projects, normally 5 transactio

  • IDOC'S error

    Hi GURUS: I got the following error when loading selection criteria from flat file thru Infopackage. Error 26 - related to IDOC'S Pls suggest ... Thanks & Regards