A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] [HELP] Get the instance of button?

  1. #1
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86

    resolved [RESOLVED] [HELP] Get the instance of button?

    Hi, I created a code to get the instance of the button when clicked, but it's not working, any idea how to fix?

    Code:
    var slotsArray:Array = new Array(slot_01, slot_02);
    
    for (var i=0; i<slotsArray.length; i++)
    {
    	currentSlot = eval(slotsArray[i]);
    	
    	currentSlot.onRelease = function():Void
    	{
    		trace ("Botão " + i + " clicado." );
    	}
    }

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Use

    trace ("Botão " + this._name + " clicado." );

    or

    trace ("Botão " + this + " clicado." );

  3. #3
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86
    Hey bro, thank you,

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