amansoori
02-09-2006, 08:26 PM
I need to make one of my classes called Point_obj a friend of my other class called Line_obj.
then I need to define a variable called myPos of type Point_obj.
Point_obj will contain some functions like get_fake_pos() or get_real_pos.
I'm fairly new to classes in AS 2. So i appologize if my question is stupid. but i still would like some help.
Thank you very much
this is what I have as an example just to make the conncetion work. but it doesnt.
-----------------------------------
this is my Point_obj
class Point_obj extends MovieClip
{
var myX;
var myY;
public function get_color_fcn():Void
{
trace("get_color_fcn");
}
public function get_transparency_fcn():Void
{
trace("hi");
}
}
--------------------------------------
this is my Lines_obj
class Lines_obj extends Point_obj implements Shapes_obj
{
var myPos:Point_obj;
public function setColor():Void{
trace("in setColor");
}
public function display():Void{
trace("in display");
}
}
-----------------------------
This is done on the main frame of my flash page.
_root.createEmptyMovieClip("myTestMovie",544);
mytest = new Lines_obj("myTestMovie");
mytest.myPos.get_color_fcn; //this doesnt work????
mytest.display(); //this works...
then I need to define a variable called myPos of type Point_obj.
Point_obj will contain some functions like get_fake_pos() or get_real_pos.
I'm fairly new to classes in AS 2. So i appologize if my question is stupid. but i still would like some help.
Thank you very much
this is what I have as an example just to make the conncetion work. but it doesnt.
-----------------------------------
this is my Point_obj
class Point_obj extends MovieClip
{
var myX;
var myY;
public function get_color_fcn():Void
{
trace("get_color_fcn");
}
public function get_transparency_fcn():Void
{
trace("hi");
}
}
--------------------------------------
this is my Lines_obj
class Lines_obj extends Point_obj implements Shapes_obj
{
var myPos:Point_obj;
public function setColor():Void{
trace("in setColor");
}
public function display():Void{
trace("in display");
}
}
-----------------------------
This is done on the main frame of my flash page.
_root.createEmptyMovieClip("myTestMovie",544);
mytest = new Lines_obj("myTestMovie");
mytest.myPos.get_color_fcn; //this doesnt work????
mytest.display(); //this works...