A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: [RESOLVED] Code causes mysterious lock-up

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    16

    resolved [RESOLVED] Code causes mysterious lock-up

    I've got a button, based on how many times you've pressed it it displays a message. This is the code:

    Actionscript Code:
    stop();
    cexitbt.addEventListener(MouseEvent.MOUSE_DOWN,gotoCMainframe);
    var ClickCounter:Number;
    var errortext:MovieClip;
    this.ClickCounter =0;
    //return;

    this.brainbt.addEventListener(MouseEvent.MOUSE_DOWN,interfaceMe);
    function interfaceMe(event:MouseEvent):void
    {
        this.ClickCounter +1;
       
        if(this.ClickCounter >= 9)
        {
            this.errortext.gotoAndStop(10);
        }
        else
        {
        this.errortext.gotoAndStop(this.ClickCounter);
        return;
        }
    }


    qlbt.addEventListener(MouseEvent.MOUSE_DOWN,qualityLow);
    function qualityLow(event:MouseEvent):void
    {
    stage.quality = "low";
    }
    qmbt.addEventListener(MouseEvent.MOUSE_DOWN,qualityMed);
    function qualityMed(event:MouseEvent):void
    {
    stage.quality = "medium";
    }
    qhbt.addEventListener(MouseEvent.MOUSE_DOWN,qualityHi);
    function qualityHi(event:MouseEvent):void
    {
    stage.quality = "high";
    }
    qbbt.addEventListener(MouseEvent.MOUSE_DOWN,qualityBest);
    function qualityBest(event:MouseEvent):void
    {
    stage.quality = "best";
    }

    This obviously doesn't work because the return is commented out. But if I un-comment it, ALL the buttons on the frame stop working! I have no idea what's going on and its starting to aggravate me. Any ideas?

    EDIT: Okay, nevermind... turns out making it add and assign one (this.ClickCounter +=1) fixed the counter and putting all the listeners before the return fixed that issue.
    Last edited by Rajada; 03-10-2010 at 05:32 PM.

Tags for this Thread

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