A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: AS3 button display

  1. #1
    Senior Member
    Join Date
    Feb 2006
    Posts
    124

    AS3 button display

    Hi there

    I have 9 button elements in an array that are number 0 to 9 that works, but the output_txt dynamic text field will not display the number for that button when clicked.

    any ideas?

    PHP Code:
    var num:int;
    var 
    btnNum:int btnArray.length;

    for (var 
    i:int 0btnNumi++) {
        
    this["input_"+i].buttonMode true;
        
    this["input_"+i].mouseChildren false;
        
    this["input_"+i].textNum.text i;
        
    this["input_"+i].num i;
        
    this["input_" i].addEventListener(MouseEvent.CLICK,rClick);
        function 
    rClick(evt:MouseEvent):void {
            if (
    output_txt.text.length 2) {
                
    //num = btnNum[c].name;
                //output_txt.text += evt.target.name;
                //output_txt.text += this.num;
                //output_txt.appendText(evt.target.name);
                
    output_txt.appendText(String(this.num));//this will only display the number 0.
            
    }
        }


  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Try:

    PHP Code:
    output_txt.appendText(String(MovieClip(evt.target).textNum.text)); 

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