colfaxrev
07-17-2008, 02:38 AM
i'm just trying to load a swf. and i'm getting errors...
here's my code
package com.bryan.testing
{
import flash.display.Sprite;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
public class Theme extends Sprite
{
private var p_loader:URLLoader;
private var p_theme:Sprite;
public function Theme()
{
p_loader = new URLLoader();
p_loader.contentLoaderInfo.addEventListener(Event. COMPLETE, p_onLoadComplete);
}
public function load(url:String):void
{
p_loader.load(new URLRequest(url));
}
private function p_onLoadComplete(event:Event):void
{
p_theme = Sprite(p_loader.content);
}
public function get theme():Sprite
{
return p_theme;
}
}
}
i am getting these errors...
1119: Access of possibly undefined property contentLoaderInfo through a reference with static type flash.net:URLLoader.
1119: Access of possibly undefined property content through a reference with static type flash.net:URLLoader.
here's my code
package com.bryan.testing
{
import flash.display.Sprite;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
public class Theme extends Sprite
{
private var p_loader:URLLoader;
private var p_theme:Sprite;
public function Theme()
{
p_loader = new URLLoader();
p_loader.contentLoaderInfo.addEventListener(Event. COMPLETE, p_onLoadComplete);
}
public function load(url:String):void
{
p_loader.load(new URLRequest(url));
}
private function p_onLoadComplete(event:Event):void
{
p_theme = Sprite(p_loader.content);
}
public function get theme():Sprite
{
return p_theme;
}
}
}
i am getting these errors...
1119: Access of possibly undefined property contentLoaderInfo through a reference with static type flash.net:URLLoader.
1119: Access of possibly undefined property content through a reference with static type flash.net:URLLoader.