Re: [Flashcoders] private/public troubles

2005-12-14 Thread grant
did you type your instance of oCore on root ?

if your data is not typed the iDE will not enforce access modifiers.

e.g

var core:Core = new Core()
trace (core.oParam); /// should not compile

var anotherCore = new Core()
trace (anotherCore .oParam); /// should compile as anotherCore is not typed.

because you are declaring it on root is probably not typed.  Why put it on root 
?

Grant.

- Original Message -
From: PR Durand [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: 12/14/05 9:54 AM
Subject: [Flashcoders] private/public troubles

 Hi List!
 
 This is not really a problem, but rather a question cause it seems 
 strange...
 
 I've got a Core.as class containing
 private var oParam:ParamMngr;
 and
 this.oParam = new ParamMngr();
 
 in the ParamMngr class, we can see
 private var mcGround:MovieClip;
 and theuse of it.
 
 into flash, on main stage, I've put the following:
 import com.domain.Core;
 _root.oCore = new Core();
 
 and then tried
 trace(_root.oCore.oParam.mcGround);
 -- it worked !!!
 
 why? each variable is private... so how can it run?
 
 thx,
 
 PR
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] private/public troubles

2005-12-14 Thread PR Durand

Thanx a lot Grant,
I think you pointed right. 'will test it.
Why on _root? because the project is a full external code, and this 
class is the core of the application, so why not putting it on _level0 
(so mainSwf._root) ?

Is it better to make a CoreComponent and drag it to the scene?
PR


[EMAIL PROTECTED] a écrit :


did you type your instance of oCore on root ?

if your data is not typed the iDE will not enforce access modifiers.

e.g

var core:Core = new Core()
trace (core.oParam); /// should not compile

var anotherCore = new Core()
trace (anotherCore .oParam); /// should compile as anotherCore is not typed.

because you are declaring it on root is probably not typed.  Why put it on root 
?

Grant.

- Original Message -
From: PR Durand [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: 12/14/05 9:54 AM
Subject: [Flashcoders] private/public troubles

 


Hi List!

This is not really a problem, but rather a question cause it seems 
strange...


I've got a Core.as class containing
private var oParam:ParamMngr;
and
this.oParam = new ParamMngr();

in the ParamMngr class, we can see
private var mcGround:MovieClip;
and theuse of it.

into flash, on main stage, I've put the following:
import com.domain.Core;
_root.oCore = new Core();

and then tried
trace(_root.oCore.oParam.mcGround);
-- it worked !!!

why? each variable is private... so how can it run?

thx,

PR

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
   



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


 



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] private/public troubles

2005-12-14 Thread grant
If I have a main Application class I generally drag it to the stage and then in 
my external code I have the application start in the onload method of the 
class.  I never use root, in your case its probably not a big deal I just find 
sometime in the future a use of root would come back and bite me.

using _root is generally considered a no-no.

stone the blasphemer!, stone the blasphemer !  :)

Grant

- Original Message -
From: PR Durand [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: 12/14/05 11:21 AM
Subject: Re: [Flashcoders] private/public troubles

 Thanx a lot Grant,
 I think you pointed right. 'will test it.
 Why on _root? because the project is a full external code, and this 
 class is the core of the application, so why not putting it on _level0 
 (so mainSwf._root) ?
 Is it better to make a CoreComponent and drag it to the scene?
 PR
 
 
 [EMAIL PROTECTED] a écrit :
 
 did you type your instance of oCore on root ?
 
 if your data is not typed the iDE will not enforce access modifiers.
 
 e.g
 
 var core:Core = new Core()
 trace (core.oParam); /// should not compile
 
 var anotherCore = new Core()
 trace (anotherCore .oParam); /// should compile as anotherCore is not typed.
 
 because you are declaring it on root is probably not typed.  Why put it on 
 root ?
 
 Grant.
 
 - Original Message -
 From: PR Durand [EMAIL PROTECTED]
 To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
 Sent: 12/14/05 9:54 AM
 Subject: [Flashcoders] private/public troubles
 
   
 
 Hi List!
 
 This is not really a problem, but rather a question cause it seems 
 strange...
 
 I've got a Core.as class containing
 private var oParam:ParamMngr;
 and
 this.oParam = new ParamMngr();
 
 in the ParamMngr class, we can see
 private var mcGround:MovieClip;
 and theuse of it.
 
 into flash, on main stage, I've put the following:
 import com.domain.Core;
 _root.oCore = new Core();
 
 and then tried
 trace(_root.oCore.oParam.mcGround);
 -- it worked !!!
 
 why? each variable is private... so how can it run?
 
 thx,
 
 PR
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
   
 
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders