A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: hot link text in dynamically loaded txt fields

  1. #1
    Sick of the web
    Join Date
    Nov 2000
    Posts
    160

    hot link text in dynamically loaded txt fields

    I have text being loaded into a text field from a .txt file outside the movie..... Everything is working well.... however, I cannot seem to formate the text in any usefull fashion nor create hot link text .... can anyone help with this?

    thanks in advance.

  2. #2
    HELP>>>ACTIONSCRIPT DICTIONARY
    Join Date
    Feb 2000
    Location
    In the Present Moment
    Posts
    1,041
    You need to set your text field to html text and then in your text file use the a href="blah blah" as normal.

    Open up the reference window and look in the index under html text to see the limted HTML formatting you can do.

    When you say "format the text in any useful fashion", what do you mean by that? You won't be able to kern the text but you can use normal html formatting tags like bold, italic and even color tags.

    Good Luck!
    Antibody
    "Our deepest fear is not that we are inadequate.
    Our deepest fear is that we are powerful beyond measure." - N. Mandela

  3. #3
    FK's Official War Driver wiReZ's Avatar
    Join Date
    Jun 2002
    Location
    wireless
    Posts
    615
    Here is the HTML formatting page for Flashhttp://www.macromedia.com/support/fl...s/htmltext.htm

    Check to see if the HTML formatting is on <> with this image.
    My current rig: AMD Athlon64 3500+(Winchester Core) MSI K8N Neo2 Platinum - 1GB
    (2x512MB) Kingston HyperX DDR333 BH5 - ATI All-In-Wonder 9800 Pro 128mb - SB Audigy 2
    WD 80GB 7200RPM 8MB - WD 250GB 7200RPM 8MB - MAX 120GB 7200RPM 8MB - Dell 2001FP 20.1 LCD

  4. #4
    Sick of the web
    Join Date
    Nov 2000
    Posts
    160
    Hmmmmm,, I tried your'alls advice,,,but still no dice....

    the <> html button is on....everything is loading into the text field as it should, but... I'm getting

    <a href="info@bluegelmedia.com>email</a>

    instead of

    "email" as a hot link.......

    I had to use the following code to allow the dynamically loaded text to be scrollable..... do you see anything in the code which could be causing the trouble?


    hometext = new LoadVars();
    hometext.load("content.txt");
    hometext.onLoad = function(success) {
    _root.contentbox.text = this.homepage;
    };
    // this code allows html formatiing
    contentbox.html = true;
    contentbox.htmlText = this.var1;

  5. #5
    Sick of the web
    Join Date
    Nov 2000
    Posts
    160
    that was odd! part of my last reply disapeared....

    it said ...

    Im getting the html tags are being loaded into my text field as regular text rather than as working html tags....

  6. #6
    HELP>>>ACTIONSCRIPT DICTIONARY
    Join Date
    Feb 2000
    Location
    In the Present Moment
    Posts
    1,041
    Can you attach your textfile? or a textfile that shows a sample of how you are formatting your text in it? I will try to take a look at it as soon as I can.

    Thanks.
    Antibody
    "Our deepest fear is not that we are inadequate.
    Our deepest fear is that we are powerful beyond measure." - N. Mandela

  7. #7
    Sick of the web
    Join Date
    Nov 2000
    Posts
    160
    Here is the .txt file.I've also attached the .txt file..... thanks for checking it out...



    &homepage=Home Page - place you home page text here.
    Remember! All you have to do is type your content into a simple .txt file provided as part of your template purchase. No need to go off buying an HTML editor or learning Flash.
    This is the quickest, easiest and most inexpensive way you can get a web site.
    Have it up within minutes.

    &about=About Us Page - place your about us content here

    &services=Services Page - place your services content here.

    &links=Links Page - place your links content here.

    &contact=Contact Page - place your contact information here. Email <a href="info@bluegelmedia.com>info@bluegelmedia.com</a>

    &moto=Your company's slogan here....... tell them what you stand for!
    Attached Files Attached Files

  8. #8
    HELP>>>ACTIONSCRIPT DICTIONARY
    Join Date
    Feb 2000
    Location
    In the Present Moment
    Posts
    1,041
    Okay mang, here is what I did.. I took your code from above and changed it to this:

    Code:
    hometext = new LoadVars();
    hometext.load("content.txt");
    hometext.onLoad = function(success) {
    _root.contact.htmlText = this.contact;
    };
    Just so I could see the "contact" var do something (which by the way is the only thing in your text file that has html tags in it).

    I then placed a dynamic text field on the stage with the name "contact" and made sure that the <> was selected in the text field property box.

    I had to make some changes in your text file as well. You were missing the end quote in the url in the href tag so I added that, as well as the underline opening and closing tags. This is done because Flash doesn't inherently underline hyperlinks, so you have to do it manually.

    This should head you in the right direction. I am not sure how your movie was setup so I can't tell you why you were getting an error but I think it might be because the code in your post above was pointing to your var "homepage", yet homepage doesn't have any html tags in it. If you want me to look at your actual .fla, post that too and I can take a look.

    Good Luck!
    Antibody
    "Our deepest fear is not that we are inadequate.
    Our deepest fear is that we are powerful beyond measure." - N. Mandela

  9. #9
    I Feel Like Him cracker23's Avatar
    Join Date
    Jan 2001
    Location
    Philly, USA
    Posts
    117
    Hey Antibody and/or Goldpan,

    I'm having trouble with coding my href's for Flash and was wondering if one of you guys can help me out. When I created my dynamic text field (with html enabled) I can format my text with ease. I've loaded external text files that were coded using styles and I've done it in the Actionscript window without laoding any files but I've never been able to get my link rollovers to work. Where do you place the Hover, Link, and Visited code in Flash and/or the external txt file; what would it look like?

    Thanks alot fellas

  10. #10
    HELP>>>ACTIONSCRIPT DICTIONARY
    Join Date
    Feb 2000
    Location
    In the Present Moment
    Posts
    1,041
    You will have to use Actionscript to change states on your rollover. Flash doesn't inherently make your links act like the a href tags on an html page.

    My suggestion is to open up the Reference guide (Shift-F1) and go to OBJECTS>>>MOVIE>>>TEXTFORMAT. This is how you will need to make your hyperlinks have activity. You can probably make visited links stay highlighted for the duration of a user's visit, but those "already visited" sites won't be lit on subsequent visits, unless of course you save a cookie or otherwise plan for it.

    I am swamped at work today so I'm not able to provide any code examples at the moment. I will see if I can get to it a little later. Check out the TEXTFORMAT object in the mean time. I'm sure you can figure it out.

    Good Luck!
    Antibody
    "Our deepest fear is not that we are inadequate.
    Our deepest fear is that we are powerful beyond measure." - N. Mandela

  11. #11
    FK's Official War Driver wiReZ's Avatar
    Join Date
    Jun 2002
    Location
    wireless
    Posts
    615
    Originally posted by cracker23
    Hover, Link, and Visited code
    Actually, you cannot do Hover, active, link, and visisted codes for each piece of text that is linked. Flash only supports HTML 1.0

    http://www.macromedia.com/support/flash/htmltext.htm

    Sorry.
    My current rig: AMD Athlon64 3500+(Winchester Core) MSI K8N Neo2 Platinum - 1GB
    (2x512MB) Kingston HyperX DDR333 BH5 - ATI All-In-Wonder 9800 Pro 128mb - SB Audigy 2
    WD 80GB 7200RPM 8MB - WD 250GB 7200RPM 8MB - MAX 120GB 7200RPM 8MB - Dell 2001FP 20.1 LCD

  12. #12
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You maybe could cheat it! Or fake it!

    You can't use anchors as such in dynamic textfields either, and I've cheated it:

    http://members.lamicro.com/~FGill/faq.html

  13. #13
    FK's Official War Driver wiReZ's Avatar
    Join Date
    Jun 2002
    Location
    wireless
    Posts
    615
    Fill us in oldnewbie!
    My current rig: AMD Athlon64 3500+(Winchester Core) MSI K8N Neo2 Platinum - 1GB
    (2x512MB) Kingston HyperX DDR333 BH5 - ATI All-In-Wonder 9800 Pro 128mb - SB Audigy 2
    WD 80GB 7200RPM 8MB - WD 250GB 7200RPM 8MB - MAX 120GB 7200RPM 8MB - Dell 2001FP 20.1 LCD

  14. #14
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    If you're referring to the anchor stuff...

    http://www.flashkit.com/board/showth...&highlight=faq

    If you're talking highlighted & visited links, use your imagination!

    I may look into it tonight, after I take care of my friend george1969's problem.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center