try adding a Delegate to fix the scope issue.

import mx.utils.Delegate;
class Main {
var myButton:Button; // placed on stage in authoring time

function init() {
  myButton.onRelease = Delegate.create ( this, doSomething );
}

function doSomething() {
  trace("something");
}
}

Cheers,

Andrew.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to