clarkk
clarkk

Reputation: 27685

classes and paths

I'm having problems with a class and it's path...

Player.as, Line 4 1172: Definition Stream could not be found.

/main.as

import player.Player;
var _Player = new Player();

/player/Player.as

package player {
 import flash.display.Sprite;

 import Stream; // Can't find Steam

 public class Player extends Sprite {
  public var _Stream = null;

  public function Player(){
   var _Stream = new Stream();
  }
 }
}

/player/Stream.as

package player {
 import flash.display.Sprite;

 public class Stream extends Sprite {
  public function Stream(){

  }
 }
}

Upvotes: 0

Views: 52

Answers (2)

StapleGun
StapleGun

Reputation: 740

Your import statement should be

import player.Stream;

Imports always use the convention [package(s)].[Class]. Using a tool like FlashDevelop which automatically creates the import statements for you can make this problem much easier to avoid.

Upvotes: 0

Senad Meškin
Senad Meškin

Reputation: 13756

import player.Stream;

I hope this helps

Upvotes: 2

Related Questions