actionscript 3 - 1120: Access of undefined property - moving functionality to external package -


hello dear stackoverflowers! here problem...

i'm trying move basic functionality object external package.

i've got movieclip item in library name mcunit: rectangle f8-ed in move clip. i'm setting linkage package want use: clgameunit;

here part of clgameunit code:

package  {     import flash.display.movieclip;     import flash.geom.point;     import flash.events.mouseevent;      public class clgameunit extends movieclip     {              // declaring local object related variable         var clgu:movieclip = new movieclip();         var isover:boolean = false;          // declaring global object related variable         public var b_u_selected:boolean = false;         public var p_u_coordinates:point = new point();         public var u_image:int = 0;          //declaring object related methods         clgu.addeventlistener (mouseevent.click, on_object_lclick);         clgu.addeventlistener (mouseevent.mouse_over, onobjectmouseover);         clgu.addeventlistener (mouseevent.mouse_out, onobjectmouseout);         clgu.addeventlistener (mouseevent.right_click, on_object_rclick);          public function clgameunit ()         {         }                  ....     } } 

and error it:

1120: access of undefined property clgu. 1120: access of undefined property on_object_lclick. 1120: access of undefined property ... [other event listeners functions] 

already tried everything. making constructor send object undefined property clgu:

public function clgameunit (obj: movieclip) {     clgu = obj; } 

and on time line call constructor manually:

var mcgameobj: clgameunit = new clgameunit (mcgunit); 

mcgunit instance name mcunit instance assign in properties. here thing become more complicated discarded variant.

if there need upload project, gladly!

really need fellaz!

put these lines function

clgu.addeventlistener (mouseevent.click, on_object_lclick); clgu.addeventlistener (mouseevent.mouse_over, onobjectmouseover); clgu.addeventlistener (mouseevent.mouse_out, onobjectmouseout); clgu.addeventlistener (mouseevent.right_click, on_object_rclick); 

for example

public function clgameunit () {     init(); }  private function init():void {     clgu.addeventlistener (mouseevent.click, on_object_lclick);     clgu.addeventlistener (mouseevent.mouse_over, onobjectmouseover);     clgu.addeventlistener (mouseevent.mouse_out, onobjectmouseout);     clgu.addeventlistener (mouseevent.right_click, on_object_rclick); } 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -