A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Button to call URL

  1. #1
    Junior Member
    Join Date
    Sep 2004
    Posts
    12

    Button to call URL

    I have a button that I need to call a URL. I am using the following script:

    stop();

    import flash.events.MouseEvent;

    var request:URLRequest = new URLRequest("http://www.idyllwildcommunitynetwork.org");

    icn_bttn.addEventListener(MouseEvent.CLICK,b2bClic k);

    function b2bClick(event:MouseEvent):void{
    navigateToURL(request);
    }

    I don't get the "hand" when I hover over the button and, of course, it doesn't call the URL.

  2. #2
    Member
    Join Date
    Feb 2010
    Posts
    79
    Hi,
    Your script is correct... see the add Event listener line. You have given the space for function name "b2bClic k". remove space.
    stop();

    import flash.events.MouseEvent;

    var request:URLRequest = new URLRequest("http://www.idyllwildcommunitynetwork.org");

    icn_bttn.addEventListener(MouseEvent.CLICK,b2bClic k);

    function b2bClick(event:MouseEvent):void{
    navigateToURL(request);
    }

  3. #3
    Senior Member
    Join Date
    Jan 2010
    Posts
    141
    if icn_bttn is a movie clip and not a true button all you need to do to get the "hand" to show up is type:

    icn_btth.buttonMode = true;

  4. #4
    Junior Member
    Join Date
    Sep 2004
    Posts
    12
    Sorry, there is no space it is b2bClick. I don't know why it showed like that sine I did a cut and paste.

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