Results 1 to 7 of 7

Thread: Script interferences

  1. #1
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Script interferences

    Can someone please tell me, why this script causes my movie to go haywire when I add something to the stage such as a scroller(even a UIScrollbar):

    //--- Tutorial project file provided courtesy of SchoolofFlash.com ---//

    aboutBmc.buttonMode = true;
    resumeBmc.buttonMode = true;
    pressBmc.buttonMode = true;
    fansBmc.buttonMode = true;
    contactBmc.buttonMode = true;
    homeBmc.buttonMode = true;
    aboutBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
    aboutBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
    resumeBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
    resumeBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
    pressBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
    pressBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
    fansBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
    fansBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
    contactBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
    contactBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
    homeBmc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
    homeBmc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);


    function onButtonOver(e:MouseEvent):void
    {
    e.currentTarget.gotoAndPlay("over");
    }

    function onButtonOut(e:MouseEvent):void
    {
    e.currentTarget.gotoAndPlay("out");
    }


    I am using this script on some buttons to give them a rollover/rollout effect. Like I mentioned, when I add a scrollbar to the stage and play the movie, the buttons keep looping the effect(ignoring all the the "stop" actions)and the scroll bar blinks erratically. Thanks for your help.

    Anthony

    P.S. I also am not sure how to give the buttons a directive such as getUrl since I am trying this movieclip as button idea. First time using AS3.

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Code:
    button_name.onRollover = function() {
         this.gotoAndPlay("over");
    }
    
    button_name.onRollOut = function() {
         this.gotoAndStop("out");
    }
    
    button_name.onRelease = function() {
       getURL("http://sitename.com", "_self");
    }
    This will give the buttons their rollover and rollout effects as well as get the Url when pressed and released.

    Shouldn't affect anything else you do on the stage.

    If you need more, please define "haywire" or provide the .fla
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your help, I'll give it a try today.

    AG

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by BLiZZaRD View Post
    Code:
    button_name.onRollover = function() {
         this.gotoAndPlay("over");
    }
    
    button_name.onRollOut = function() {
         this.gotoAndStop("out");
    }
    
    button_name.onRelease = function() {
       getURL("http://sitename.com", "_self");
    }
    This will give the buttons their rollover and rollout effects as well as get the Url when pressed and released.

    Shouldn't affect anything else you do on the stage.

    If you need more, please define "haywire" or provide the .fla
    @Blizz...
    Once again, you're very right ...for AS2. The OP is using AS3.

    @Anthony...
    As Blizzard says, please define "haywire". Are you getting any errors? If possible, zip up your fla and post it here.

  5. #5
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Medyman View Post
    @Blizz...
    Once again, you're very right ...for AS2. The OP is using AS3.
    Yes, and once again proving AS2 RULZ!!! N00b! (feeling 3rd grader-ish today, don't mind me)

    Also should have CS4MC when I get home! Can't wait to check mail! WOOT!
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  6. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Also should have CS4MC when I get home! Can't wait to check mail! WOOT!
    Are you thinking about switching to AS3?

  7. #7
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Switching? BAH! You frighten me! No, but I still have Flash 4 and 5 Installed on my machine, so might as well have 7, 8, 9 and 10 too!
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •