how to target scenes from external actionscript file (.as)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Max58kl
    New Member
    • Nov 2007
    • 37

    how to target scenes from external actionscript file (.as)

    I have a flash file containing 9 scenes.
    I thought that it would be a good idea to place all
    code in an actionscript (.as) file.
    //include "main_as.as ";

    On one scene I have an array of buttons

    Code:
    var myArray:Array = [btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8];
    This works fine as is.

    If I add two more buttons to a second scene
    btn9, btn10 and add them to my .as file

    Code:
    var myArray:Array = [btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn10];
    The animations work on the buttons in the first scene, but not the second.

    If I try to include the .as file in the second scene also

    //include "main_as.as ";

    I receive lots of duplicate function errors.
Working...