views:

247

answers:

2

Hello all,
I've got some actionscript which begins with:
package obfus_plugin{
import org.flowplayer.model.Plugin;
import org.flowplayer.util.Arrange;
import org.flowplayer.model.PluginModel;
import org.flowplayer.view.Flowplayer;
public class obfus extends Sprite implements Plugin {

and when I try to publish, I get the error:

5001: The name of package 'obfus_plugin' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:\flowplayer\url_secure\src\actionscript\obfus_plugin\obfus.as

the location of the .as file is:

C:\flowplayer\url_secure\src\actionscript\obfus_plugin\obfus_plugin.as

In my classpaths I have:

C:\flowplayer\url_secure\src\actionscript\obfus_plugin  

What am I doing wrong? Did I miss a directory somewhere? All help is GREATLY appreciated.

+2  A: 

Have you tried moving the file to the suggested location?

`C:\Documents and Settings\***\My Documents\My Dropbox\Public\obfus_plugin\obfus_plugin.as`

It's telling you that's where it should be placed. From the classpath root, the actionscript file should live in a nest of folders that reflects the package name.

Say you have an actionscript file with class in package X.Y.Z, the file should live in folder %classpath%\X\Y\Z

spender
the location of the .as file is "C:\Documents and Settings\***\My Documents\My Dropbox\Public\obfus_plugin\obfus_plugin.as", am I missing a directory somewhere? (the editor keeps deleting the slash between "Documents and Settings" and "***")
danwoods
Is the error saying that's where I should move the file, or that's where the error is?
danwoods
What is the class name of the class within the file? This should match the filename.
spender
The class name looks like: "public class obfus_plugin extends flash.display.MovieClip implements org.flowplayer.model.Plugin"
danwoods
A: 

The directory structure should match the package structure, with classpath as it's root.

package{} matches %classpath%.

package A{} matches %classpath%/A.

So, instead of:

C:\flowplayer\url_secure\src\actionscript\obfus_plugin

You should use, as classpath:

C:\flowplayer\url_secure\src\actionscript

or place the file in a new folder:

C:\flowplayer\url_secure\src\actionscript\obfus_plugin\obfus_plugin

or even use the default package in the .as file:

package {
    import [...]
}
MrKishi
Thanks__________
danwoods