A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [F8] Quicker way to write these button actions

Threaded View

  1. #3
    http://www.in3d.eu Kostas Zotos's Avatar
    Join Date
    Jul 2007
    Location
    Athens - Greece
    Posts
    408
    Hi all,

    Except of the issue noted by vinayak.kadam, a general code to achieve this would be for example:
    PHP Code:
    for (i=1;i<=30;i++){
        
    //Assume all buttons are in the  _root (main stage) otherwise you have to provide
        // the correct target path eg. _root.Container["button"+i] (if they are inside a "Container" clip for example)
        
    var myButton=_root["button"+i

        
    myButton.onRelease=function(){
            
    trace(this)
            
    this.gotoAndStop("selected"); 
            
    // Your rest actions here..
        
    }

    Best!

    Kostas
    Last edited by Kostas Zotos; 05-14-2008 at 01:58 PM.
    K. Zotos online portfolio: http://www.in3d.eu

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