I'm afraid that makes no sense to me.
It's perfectly allright to make instances private, as long as they're created
through code.
package {
import flash.display.MovieClip;
import fl.controls.Button;
public class MyComponent extends MovieClip {
private var _btn:Button;
function MyComponent() {
trace("MyComponent ::: CONSTRUCTOR");
init();
}
function init():void {
_btn = new Button();
_btn.label = "I'm Private";
_btn.move(10, 100);
addChild(_btn);
}
}
}
So why is it different when they're placed on stage?
I'm probably just missing something (and trying to understand the why of it).
regards,
Muzak
----- Original Message -----
From: "Francis Cheng" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, July 13, 2007 3:34 AM
Subject: RE: [Flashcoders] Accessing MovieClips on a timeline from an AS3 class
Sorry, I wasn't clear about my theory. Let me try again. I think that
you have to declare variables that represent stage instances as public
because Flash CS3 automatically executes an assignment statement at
runtime that involves those variables. If those variables are declared
as private, they are invisible at runtime, so the assignment attempt
results in an error.
Francis
_______________________________________________
[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