2 Replies Latest reply on Oct 1, 2007 6:32 PM by Newsgroup_User

    Problems with #include

    Master_Brown
      I've been working with Flash and .as files for a while now, and this problem pops in occasionaly. I can generaly get rid of it by creating a new Flash file or .as, but this time it's not working, and it has becomed a major problem for me.

      Let's say I have a very simple file structure where everything is in one directory, .fla, .as, everything, very basic. From the .fla file, I call :
      - -
      #include "as.as"
      - -
      I keep getting an error saying the file as.as can't be found, even though I know it does, is in the right place, and it's got code in it.

      Which reasons could prevent Flash from finding a .as file?
        • 1. Re: Problems with #include
          Master_Brown Level 1
          Simply changing the location of the files (.fla and .as) as just resolved this problem. Changing back the location of the files back to the old directory causes them to not work again.
          • 2. Re: Problems with #include
            Level 7
            Master Brown,

            > Simply changing the location of the files (.fla and .as) as
            > just resolved this problem. Changing back the location
            > of the files back to the old directory causes them to not
            > work again.

            Pointless as the suggestion may sound, try renaming your code file from
            as.as to something else. By convention (just an arbitrary, personal choice)
            I usually name my AS files a desriptive name preceeded by the prefix "scr"
            (for script). For example ...

            scrMain.as
            scrGameEngine.as
            scrStyles.as

            This distinguishes that sort of ActionScript file from actual custom
            class files, which are required to have the same name as the classes they
            contain. For example, if I write a SoundSync class, it must be saved in a
            file named SoundSync.as.

            My hunch is a long shot, but something about your current file's name
            "as.as" strikes me as prone to confuse Flash.


            David Stiller
            Adobe Community Expert
            Dev blog, http://www.quip.net/blog/
            "Luck is the residue of good design."