PDA

View Full Version : trying to load a swf...


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.

colfaxrev
07-17-2008, 02:54 AM
nm, i was supposed to be using flash.display.Loader;

not flash.net.URLLoader;

oooooops

sikurus
03-01-2010, 09:36 PM
hi!

I have the same problem with my as3 like yours but i couldn't find way to fix it.