2 Replies Latest reply: Jun 3, 2012 8:41 AM by FLAdude RSS

    Native Extensions don't work in Flash CS6

    FLAdude Community Member

      Edit: Never mind.

       

      Whoever made the native extension, despite it being a useful function, used the abominable package naming structure of:

      com.coder.nativeExtensions.NameOfClass.NameOfClass

      Anybody going to use it would import com.coder.nativeExtensions.NameOfClass, in which case it would not work because the name of class is also the name of an extra package directory and you have to repeat it twice which makes no sense, but it works with the class name redundantly repeated twice in the import.

       

      ------------------------------------------------------------------------------------------

       

      I am on Flash Professional CS6. I upgraded it just so I could use Native Extensions. I have browsed and added the native extension to libraries. I have added the import statement and added the xml entry for extension ID.

       

      If I try to run it I get "Definition could not be found" error for the package import. There is a complete lack of documentation or any way to find out why it isn't working. All I get is an unhelpful error that doesn't address the actual problem.

       

      How do you get native extensions to work?

        • 1. Re: Native Extensions don't work in Flash CS6
          marcfolio Community Member

          So how did you get it to work. I'm still very confused.

          • 2. Re: Native Extensions don't work in Flash CS6
            FLAdude Community Member

            There was nothing wrong with CS6 in this situation, it was that the package name of the specific extension I was trying to use that was horribly named, to the point you had to repeat the class name twice, which means most developers would only put it once and it wouldn't work. Being that this was the first native extension I tried to run, it seemed that the native extension feature didn't work.

             

            Say your name is Bob Smith and you make a native extension that runs your hardware camera as a flashlight.

             

            If you name the class FlashLight and the package name com.bobsmith.nativeExtensions.FlashLight

            people would have to put

            import com.bobsmith.nativeExtensions.FlashLight.FlashLight;

            or

            import com.bobsmith.nativeExtensions.FlashLight.*;

            to import it. And that woudldn't  make much sense. "FlashLight" is the name of the class. If the class and the package subdirectory have the exact same name, people are going to think the package subdirectory is the class.

            Most people trying to import it would put

            import com.bobsmith.nativeExtensions.FlashLight;

            or

            import com.bobsmith.nativeExtensions.*;

            in which case it wounld not work.

             

            A non-insane way to name your package would be com.bobsmith.nativeExtensions.hardware

            Then one could put

            import com.bobsmith.nativeExtensions.hardware.FlashLight;

            or

            import com.bobsmith.nativeExtensions.hardware.*;

            That would make sense, either importing the FlashLight hardware feature or all hardware features in the package.