A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: button not functioning

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    4

    button not functioning

    Hello,

    I am new to Flash and using the trial Flash CS4 with AS3. The button does not open the website. I am not sure I referenced the button correctly. Could someone show me what I am missing? TIA.


    =========
    import fl.controls.Button;

    var myButton:Button = new Button();
    myButton.name = "button 39";
    myButton.addEventListener(MouseEvent.CLICK, myButtonFunction);
    function myButtonFunction(event: MouseEvent) {
    var request:URLRequest=new URLRequest("http://cnn.com");
    navigateToURL(request);
    }

  2. #2
    Señor Member Mavrisa's Avatar
    Join Date
    Oct 2005
    Location
    Canada
    Posts
    506
    all i can see is that you did not add the button to the display list:
    addChild(myButton)
    Haikus are easy
    But sometimes they don't make sense
    Refrigerator

  3. #3
    Junior Member
    Join Date
    Jun 2004
    Posts
    4
    Quote Originally Posted by Mavrisa
    all i can see is that you did not add the button to the display list:
    addChild(myButton)
    Hi Mavrisa,

    Thanks for replying. I put that line in but now the code stop executing. I could hear the audio keep progressing but the video apparently stop at frame 1 where the codes are (in the action layer). Any idea? I could PM you the fla file if you like me to do that. Thanks again.

    =========
    import fl.controls.Button;

    var myButton:Button = new Button();
    myButton.name = "button 39";
    myButton.addEventListener(MouseEvent.CLICK, myButtonFunction);
    //addChild(myButton);
    function myButtonFunction(event: MouseEvent) {
    var request:URLRequest=new URLRequest("http://flashgameu.com");
    navigateToURL(request);
    }
    Last edited by herkulis; 01-14-2009 at 11:59 PM.

  4. #4
    Junior Member
    Join Date
    Jun 2004
    Posts
    4
    I am still struggling with this. Could someone please help me making this "Home" button on the upper left corner of the file test4.fla in the link below clickable to open a web page ?

    http://uploading.com/files/3HFKH3ZT/test4.fla.html

    Thanks in advance.

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