3 Replies Latest reply on Aug 28, 2007 11:00 PM by kglad

    #include question.

    wanaryd
      Hello, I want to state variables on different frames of my movie that later decides what .as file is loaded using #include. It seems that you can't use variables though with #include... How do I do this? Example is below.

      #include var1 + var2

      If I cannot use #include... What can I use? I am in AS2.

      Thanks!!!!

        • 1. Re: #include question.
          kglad Adobe Community Professional & MVP
          you are correct. you can't do that.

          included files are compiled into the swf BEFORE runtime. they cannot be named during runtime and then have the code "included". the code in a swf is already compiled when it runs so there's no way to do this directly.

          you can, however, put different blocks of code in different swfs. you can, of course, load swfs that are determined dynamically. and you can, therefore, do what you're trying to do: load the correct code for a given situation without loading unneeded code.
          • 2. Re: #include question.
            wanaryd Level 1
            Kglad, I am very VERY appreciative of your help! Even though I knew this about #include, in the mix of things I got anxious and forgot. The external swf's will work beautifully. Thanks!
            • 3. Re: #include question.
              kglad Adobe Community Professional & MVP
              you're welcome.