Results 1 to 5 of 5

Thread: HTML anchors (top) in loaded text

  1. #1
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy HTML anchors (top) in loaded text

    Okay - so maybe I am going about this all the wrong way -

    But I have text in a scrolling text box I want to be able to anchor "top of page" links to from various points in the page. (same document navigation)
    It's a no brainer in HTML, but Flash isn't liking the link/anchor hard coding I did to my .txt document

    The document shows up fine, all the html formatting is there - but the anchor links aren't working properly -

    I used

    myData = new LoadVars();
    myData.onLoad = function() {
    myText_txt.html = true;
    myText_txt.htmlText = this.myVariable;
    };
    myData.load("content.txt");

    to call the file - which is working fine.

    and in the .txt file I used

    <a name="top">top</a> for the anchor
    <a href="#top">Back to top</a> for the link

    Suggestions?

    If there is a better (easier, less blonde) way to go about this, I am all ears -

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    I see a few potential culprits here:

    1) Are you setting the <a name=".."> tab within flash? If so, that's not going to work. Firstly, I'm not sure if Flash is able to read the <a name=".."> tag. It can read anchors but I'm not sure if all the properties are available to it. Even if it can though, your linking to the same point from where you're calling the link, so it won't make a difference. You're better off declaring that directly in your HTML.

    2) Is the link showing up in Flash? If not, it's probably because you're not escaping the quotes. Change this:
    Code:
    <a href="#top">Back to top</a>
    to
    Code:
    <a href=\"#top\">Back to top</a>

    Tip: If you're going to be using Flash for navigation, make sure there is an alternative for people that don't have Flash installed.

  3. #3
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Well - it's a text document called into Flash - so I don't want to escape them quotes (otherwise the html won't render)

    This is the site in question - J Cargill Imagethe page I am talking about is the "Packages for Individuals" link - the text is scrolling - formats seem to have taken (didn't quite get it finished) the links are active links, they just don't work.

    I'm thinking the format I am using is missing something, but I can't for the life of me figure out what.

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Oh I see...

    You can't simply bring an HTML page into flash. It doesn't quite work like that. Internal page anchors are HTML syntax. They won't work from within flash. If you had anchors set in HTML, and were calling it from Flash, that would work.

    Assuming that that's just one giant text area that you're linking to, you won't be able to get this type of thing to work. If each of the links and sections were seperate textfields, you could use the scroll property of the textfield, but I doubt that's how you have it set up because that would have required a lot of custom AS.

    May I ask why you chose to do this site in Flash? You can duplicate the functionality (and add more) using plain old HTML. Flash only adds limitations to this design.

  5. The Following User Says Thank You to Medyman For This Useful Post:

    Darqueness (04-29-2008)

  6. #5
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    It's one of those 'the customer isn't always right but thinks they are' situations.

    Thanks for your help though ;o)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •