views:

427

answers:

1

This is driving me nuts, I can run this fine with code on the main timeline, but when I put this inside of my sub Class I'm getting the Compile time error and 1180: Call to a possibly undefined method.

This is the line causing all my grief: public var splashLoader:Loader = new Loader();

What I don't get is, inside my main class I'm using this exact same syntax with a different variable to load my XML file, but I can't seem to get this to work inside of my sub class.

package src.howdinicurtain {

import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.display.MovieClip;
import flash.display.DisplayObject;
import flash.net.URLLoaderDataFormat;

public class HowdiniFrame extends MovieClip {
 trace("called HowdiniFrame");

 //public var splashLoader; // will run, but get 1010 error

 public var splashLoader:Loader = new Loader();

 public function HowdiniFrame(url:String, loadX, loadY):void
 {
  trace("inside of function");
  splashLoader.load(new URLRequest(url))
  splashLoader.x = loadX;
  splashLoader.y = loadY;
  addChild(splashLoader);
 }

}

}

This is where I'm calling the function in my main class:

hc = new HowdiniFrame(splashPath, 0, 20);
+2  A: 

import flash.net.*;

import flash.display.*;

import flash.events.Event;

^ All I needed was that /facepalm

Leon