I cannot figure out what is going on? I can import other classes to the timeline and use them just fine, but this class is giving me major problems? I am parsing XML data from my server on it and it is giving me errors that look like this.
The timeline reference and usage:
import networkScores;
var network:networkScores = new networkScores();
addChild(network);
score1Textfield.text = network.score1.toString();
The class definition:
package
{
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.display.MovieClip;
public class networkScores extends MovieClip
{
public var myXML:XML, myXMLNames:XML;
public var xmlLoaderScores = new URLLoader();
public var score1:int;
public function networkScores()
{
xmlLoaderScores.addEventListener(
Event.COMPLETE, xmlLoadedScores);
xmlLoaderScores.load(new URLRequest("pathtoxmlfile"));
}
public function xmlLoadedScores(e:Event):void
{
myXML = new XML(e.target.data);
var qName1:QName = new QName(
"http://www.w3.org/2005/Atom", "score1");
score1 = myXML.descendants(qName1)[0].toString();
}
}
}
The errors I am getting:
Scene 1, Layer 'Actions', Frame 4, Line 149 1119: Access of possibly undefined property score1 through a reference with static type networkScores.
1067: Implicit coercion of a value of type networkScores to an unrelated type flash.display:DisplayObject.
Is this a casting issue?
how can I fix this?