dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: text links in flash (help)

  1. #1
    Junior Member
    Join Date
    Apr 2005
    Posts
    10

    text links in flash (help)

    how do I make a text link to a page/url in my flash movie?
    Do I have to make a button out of each word that is a link?
    EG if I have a long text in my movie and I want one word of that text to be a link to another page?
    if u want to email me:
    cyjetsu@hotmail.com
    (no spam)

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Posts
    2,049
    This will show you how to create a array of links in your text file and flash.

    1. Create a Dynamic Text
    2. assign an Instance Name (Example: mylinks)
    3. set to "render as HTML (Look for "<>" in the Properties window)
    4. Set your lines to Multiline (in the Properties window)
    5. create a text file with your links Example below

    link0=<a href="http://www.wattsupnow.com/" target="_blank"> Wattsupnow Designs</a>&link1=<a href="http://www.flashkit.com" target="_blank"> Flashkit</a>&

    6. put your text file in the same directory as your .swf
    7. Add the actionscript to your .swf

    Actionscript on first frame or where needed

    Code:
    txtLoad = new LoadVars ();
    txtLoad.load ("mylinks.txt");
    linkfile = new Array ();
    txtLoad.onLoad = function (success) {
    	if (success){
    		for (p = 0; ; p++){
    			if (this["link" + p] != undefined){
    				mylinks.htmlText = mylinks.htmlText+this["link" + p] + newline;
    			}else{
    				break;
    			}
    		}
    	}
    };
    stop ();
    Last edited by wattsup; 04-27-2005 at 03:39 PM.

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