package {
import Scripts.Grid
public class Pathfinding {
private var $xmlLoader:URLLoader = new URLLoader();
$xmlLoader.addEventListener(Event.COMPLETE, loadXML);
$xmlLoader.load(new URLRequest("grid.xml"));
public static var DepStation:String = new String;
public static var ArrStation:String = new String;
public function Pathfinding() {
// constructor code
}
public function loadXML(e:Event):void
{
var $xml:XML = new XML(e.target.data);
var $grid:Grid = new Grid();
$grid.parseXML($xml);
trace($grid.findPath(DepStation, ArrStation));
}
}
}
Hi, my problem here is that Flash will output an error
Line 16 1046: Type was not found or was not a compile-time constant: Event.
and when I tried import Flash.events.Event, the errors will explode and produce
Line 9 1120: Access of undefined property $xmlLoader.
Line 9 1120: Access of undefined property loadXML.
Line 10 1120: Access of undefined property $xmlLoader.
Line 10 1180: Call to a possibly undefined method URLRequest.
Line 8 1046: Type was not found or was not a compile-time constant: URLLoader.
Line 8 1180: Call to a possibly undefined method URLLoader.
Line 8 1180: Call to a possibly undefined method URLLoader.
so I'm really at the end of my wits, the source for the script was http://lassieadventurestudio.wordpress.com/2008/12/09/a-star-pathfinding/ it was working before if I copied it 1:1 but now even the 1:1 clone is not working and the adaption to external actionscripts are not working.
Much help is appreciated
import flash.events.*. And you can't write code at the class level, outside of a method -- only variable declarations (with initialization).