Skip to main content
zsqrd34964785
Participating Frequently
April 18, 2017
Question

How can i apply a function multiple times in action script?

  • April 18, 2017
  • 1 reply
  • 287 views

I have a menu bar which need to use the function multiple times, how can i make the function reusable in every scene/frame?

    This topic has been closed for replies.

    1 reply

    Colin Holgate
    Inspiring
    April 18, 2017

    Scripts that are in frame 1 should be usable in any other frame. Do you have an example FLA that you can put online somewhere, that shows the problem you're having?

    zsqrd34964785
    Participating Frequently
    April 18, 2017

    But I have different scene which need to use the same function as well.

    Colin Holgate
    Inspiring
    April 18, 2017

    The script in frame 1 of scene 1 should still work in scene 2. I tried this script in scene 1:

    test();

    function test(){

      trace("test1");

    }

    and this in scene 2:

    test();

    stop();

    It traced "test1" twice. So, scene 2 was able to use scene 1's function.