A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: making text into a hyperlink

  1. #1
    Senior Member whytefly's Avatar
    Join Date
    Jun 2004
    Location
    submerged
    Posts
    363

    making text into a hyperlink

    hello all,

    i have made this scrolling application and i want some of the text being called from sample.txt to have a hyperlink attached. any ideas?

    Thank you.

    Code:
    //--------------loading external text and display it---------
    var textRequest:URLRequest = new URLRequest("sample.txt");
    var textLoader:URLLoader = new URLLoader();
    textLoader.load(textRequest);
    textLoader.addEventListener(Event.COMPLETE,fileLoaded);
    
    function fileLoaded(event:Event):void {
    text_field.text = event.target.data;
    text_field.wordWrap = true;
    }
    //------------------make buttons to scroll the loaded text-------
    var scrolling:Boolean = false;
    var scrollDirection:String;
    
    scrollDown.addEventListener(MouseEvent.MOUSE_DOWN,scrollTextDown);
    scrollUp.addEventListener(MouseEvent.MOUSE_DOWN,scrollTextUp);
    stage.addEventListener(MouseEvent.MOUSE_UP,stopScroll);
    
    function scrollTextDown(event:MouseEvent):void {
    scrolling = true;
    scrollDirection = "down";
    text_field.scrollV +=1;
    stage.addEventListener(Event.ENTER_FRAME,checkButtons);
    }
    function scrollTextUp(event:MouseEvent):void {
    scrolling = true;
    scrollDirection = "up";
    text_field.scrollV -=1;
    stage.addEventListener(Event.ENTER_FRAME,checkButtons);
    }
    function stopScroll(event:MouseEvent):void {
    stage.removeEventListener(Event.ENTER_FRAME,checkButtons);
    scrolling = false;
    }
    //---------ckecking to see if buttons are pressed-----------
    function checkButtons(event:Event):void {
    if (scrolling) {
    if (scrollDirection =="down") {
    text_field.scrollV +=1;
    } else if (scrollDirection == "up") {
    text_field.scrollV -=1;
    }
    }
    }

  2. #2
    Senior Member whytefly's Avatar
    Join Date
    Jun 2004
    Location
    submerged
    Posts
    363
    and is there any way i can control my flash app with these hyperlinks?

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