A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Multiple Buttons in AS3

  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    1

    Multiple Buttons in AS3

    Hi,

    I'm not a true programmer - I just build my own simple Flash sites once every few years when I need one.
    I'm building a site with three scenes ('HomePage', 'ProducerPage' and 'ContactPage'); I'm totally new to AS3 (successfully used AS2 before - don't know why I switched!), and I can't figure out how to get my four main buttons to work.
    I have the following code on the first frame of the first scene, top layer:
    __________________________________________________ _________
    introLink.addEventListener(MouseEvent.CLICK, introLinkClick);
    function introLinkClick(event:MouseEvent):void
    {
    navigateToURL(new URLRequest("http://www.evostudio.us/index.html"),"_self");
    }
    homeLink.addEventListener(MouseEvent.CLICK, homeLinkClick);
    function homeLinkClick(event:MouseEvent):void
    {
    gotoAndPlay(1, "HomePage");
    }
    producerLink.addEventListener(MouseEvent.CLICK, producerLinkClick);
    function producerLinkClick(event:MouseEvent):void
    {
    gotoAndPlay(1, "ProducerPage");
    }
    musicLink.addEventListener(MouseEvent.CLICK, musicLinkClick);
    function musicLinkClick(event:MouseEvent):void
    {
    navigateToURL(new URLRequest("music/music.html"),"_self");
    }
    contactLink.addEventListener(MouseEvent.CLICK, contactLinkClick);
    function contactLinkClick(event:MouseEvent):void
    {
    gotoAndPlay(1, "ContactPage");
    }
    __________________________________________________ ___
    I've checked and the instance names of each button are correct ---- what am I doing wrong?

    Much thanks!!!

  2. #2
    Senior Member somlemeg's Avatar
    Join Date
    Aug 2000
    Posts
    171
    I strongly recommend you NOT to use scenes for building a basic webpage! I'ts generally not used anymore except for animations.

    You may want to check out this tutorial: http://www.republicofcode.com/tutori.../basicwebsite/

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