A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Consolidation of ActionScript [F8]&[F9]

  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    32

    Consolidation of ActionScript [F8]&[F9]

    have been running into the same problem multiple times and I know there is an easier way to do this.. any ideas out there?

    here would be an example of some code:

    PHP Code:
    btn1.onPress = function(){
        do 
    the same thing;
        }
    btn2.onPress = function(){
        do 
    the same thing;
        }
    btn3.onPress = function(){
        do 
    the same thing;
        }
    btn4.onPress = function(){
        do 
    the same thing;
        } 

  2. #2
    flashfireworkz
    Join Date
    May 2008
    Location
    out of phase
    Posts
    2
    s'all greek to me

  3. #3
    Member
    Join Date
    Sep 2007
    Posts
    32
    some ideas...

    maybe a loop..
    this won't work by the way
    PHP Code:
    for (i=0i<5i++) {
    var 
    mc MovieClip "btn"+i;
    mc.onPress.function=(){
    do 
    the same thing;
    }

    maybe an array
    this also won't work
    PHP Code:
    var mc:Array = ["btn1","btn2","btn3","btn4"];
    mc.onPress.function=(){
    do 
    the same thing;


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