PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
multiple buttons on stage to action using forloop
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: multiple buttons on stage to action using forloop

  1. #1
    Flash Genie letschillout's Avatar
    Join Date
    Feb 2007
    31.52949, 74.347272

    multiple buttons on stage to action using forloop

    Hi, I want to multiple buttons on stage to capture switch action
    via for loop

    Actionscript Code:
    import flash.text.TextField;
    import flash.display.MovieClip;
    import flash.display.DisplayObject;

    for ( var i:int = 1 ; i < 13; i++ ){
        var curButton:DisplayObject = getChildByName("btn"+i);
        curButton.buttonMode = true;
        curButton.addEventListener ( MouseEvent.MOUSE_OVER, onMouseOver);
        curButton.addEventListener ( MouseEvent.MOUSE_OUT, onMouseOut);

    /*var clipArray:Array = [btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn10, btn11, btn12];
    for(var i:int = 0; i < clipArray.length; i++) {
        clipArray[i].buttonMode = true;
        clipArray[i].addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
        clipArray[i].addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);

    function onMouseOver(event:MouseEvent):void


    function onMouseOut(event:MouseEvent):void

        txt.s.text = "";
    Charag - 3D, Flash Games, Animations,
    Website Development & More...

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Austin, TX
    Did you have a question?

  3. #3
    Senior Member
    Join Date
    Jun 2008
    Have you adding the button on the stage?

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