Hello I have a air for android project going and I am wanting to import a actionscript class for use in the main timeline. I wrote the class and imported it, but I get the following errors:
Line 1 5001: The name of package ‘com’ does not reflect the location of this file. Please change the package definition’s name inside this file, or move the file.
Here is from the timeline
import com.networkScores;
var network:networkScores = new networkScores();
addChild(network);
trace(network.arr[0]);
Here is from the class file
package com
{
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.display.MovieClip;
public class networkScores extends MovieClip
{
public function networkScores()
{
}
}
}
Anyone have any idea what i am doing wrong here?
Make sure to have your .as class file saved in the com folder as name spaces are essentially folder structures. Then ensure class path is pointing to the right place.
For example, “
c:/as3dev/projectname/com/networkScores.as” , you can add a class path of “c:/as3dev/projectname/“. Then of course in your project properties set class to com.networkScores, if you have not yet done so.