Copy link to clipboard
Copied
I get this error when trying to import another class
C:\Users\Luke\Documents\Flash Files\NewStickFightingProject\as3\SceneSetup.as, Line 1 | 5008: The name of definition 'SetupScene' does not reflect the location of this file. Please change the definition's name inside this file, or rename the file. C:\Users\Luke\Documents\Flash Files\NewStickFightingProject\as3\SceneSetup.as |
I have two classes. My Main.as class (Document Class) and My SetupScene.as class.
All I want to do is import My SetupScene Class with my Main.as but I cant get it working for the life off me
Main.as (Document Class)
package
{
import flash.display.Sprite;
public class Main extends Sprite
{
private var SceneSet:SceneSetup;
public function Main()
{
SceneSet = addChild(new SceneSetup()) as SceneSetup;
}
}
}
SetupScene.as
package
{
import flash.display.Sprite;
public class SetupScene extends Sprite
{
var Frame1:menu = new menu();
var Frame2:Shop = new Shop();
public function SetupScene()
{
addChild(Frame1);
}
}
}
Both classes are in the same folder with the .fla and I have defined the path in my publication settings
C:\Users\Luke\Documents\Flash Files\NewStickFightingProject\as3
Does anyone know what I am doing wrong because Ive been trying to solve this for more then 2 days 😕
your class file is SceneSetup.as, not SetupScene.as
change the file name.
Copy link to clipboard
Copied
your class file is SceneSetup.as, not SetupScene.as
change the file name.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now