I have been trying to use a delegate for the Stage and have been having
problems:

 

 

/*

* This works but hate calling _root and would like to include a Boolean into
the LetsResize function. 

*/

 

private function mainController ( mc:MovieClip ) {

 

 

var resizeThis = new Object();

resizeThis.onResize = LetsResize;

Stage.addListener(resizeThis);                

LetsResize();

 

 

{

 

private function LetsResize():Void

{

            _root.anObject._x  = Stage.width-20;

 

}

 

 

 

/*

* This does not work and how I would prefer to get it to work

*/

 

private function mainController (mc:MovieClip{

{

.

// Error Rec'd: There is no method with the name 'addEventListener'

Stage.addEventListener(resizeThis, Delegate.create(this,LetsResize))

 

..

}

 

private LetsResize(evt:Object):Void

{

  anObject._x = Stage.width-20;

 

}

 

 

Does anyone know what may be going on or a workaround where I will not be
accessing root? 

 

I have used the delegate for many other things and usually it sends over the
functions.

 

Any assistance would be most appreciated,

 

-rob

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to