3 Replies Latest reply on Oct 16, 2006 3:08 PM by DazFaz

    Access class through SWF?

    Grinshtein Level 1
      I've written a class I want to let someone use, but I don't want them to have access to the .AS file. Can I import it into a SWF and allow them to call it that way?

      Is there some other way of allowing people to use classes without giving them the .as file?
        • 1. Re: Access class through SWF?
          DazFaz Level 1
          This is just a guess here but because, at run time, you compile any external .as files into the completed swf then in theory you could create an swf that any other user could import into another swf and still be able to use the class file within.
          • 2. Re: Access class through SWF?
            Grinshtein Level 1
            I tried that...

            I've tried creating SWF #1 with just 1 line :

            import MyClass;

            I compiled it and used loadMovie to put it SWF #1 into another SWF #2 - still, I can't access my class through that SWF #2...

            is loadMovie the right way to do it?
            • 3. Re: Access class through SWF?
              DazFaz Level 1
              Now this is a real shot in the dark here as Ive never really tried it but have you tried.

              rather than import (because you have already done that in your loaded swf) make a reference to the class like this

              myloadedSwf.MyClass

              Working on the principals of Object functions

              Becuase you are loading the script via an already loaded swf