how to access variables in other classes in as2
-migrated-
I am trying to access variables defined in other class of external swf.

Code: [Select]
loadMovieNum("moolga.swf", 0);
keylistener = new Object();
keylistener.onKeyDown = function ()
{
    if (Key.getCode() == 49)
    {
_root.drops = 100;
    } // end if

};
Key.addListener(keylistener);

this is the code I am using, I can access variables defined in mainmovie but where as when variables defined in other classes cannot.

can anyone tell me how to do this.
anyone ?
Quote from: "ankilla"
Code: [Select]
_root.drops = 100;
Use this instead:
Code: [Select]
_level0.container.drops = 100;
For other variables see the list below or download a variable scanner.

Code: [Select]
Found with:

for(var item in _level0.container){
    trace("_level0.container." + item + ": " + _level0.container[item] + "  ---  " + typeof(_level0.container[item]));
}

_level0.container.rnd: -2  ---  number
_level0.container.nume: muls1  ---  string
_level0.container.d: 1  ---  number
_level0.container.nr: 2  ---  number
_level0.container.josY: 500  ---  number
_level0.container.josX: 275  ---  number
_level0.container.i: 3  ---  number
_level0.container.deplasarey2: 0  ---  number
_level0.container.deplasarey: 0  ---  number
_level0.container.dify2: 9  ---  number
_level0.container.dify: -3.44999999999999  ---  number
_level0.container.deplasarex2: 0  ---  number
_level0.container.deplasarex: 0  ---  number
_level0.container.difx2: -10  ---  number
_level0.container.difx: 5.30000000000001  ---  number
_level0.container.onMouseDown: [type Function]  ---  function
_level0.container.onEnterFrame: [type Function]  ---  function
_level0.container.norInterval: 5  ---  number
_level0.container.porumbInterval: 4  ---  number
_level0.container.balonInterval: 3  ---  number
_level0.container.musteInterval: 2  ---  number
_level0.container.pesteInterval: 1  ---  number
_level0.container.pas: 0.49  ---  number
_level0.container.v3: 0.2  ---  number
_level0.container.v2: 0.05  ---  number
_level0.container.v: 0.08  ---  number
_level0.container.clapte: 1007  ---  number
_level0.container.contor: 101  ---  number
_level0.container.viata: 100  ---  number
_level0.container.vacaMove: true  ---  boolean
_level0.container.root: _level0  ---  movieclip
_level0.container.levelTime: 3500  ---  number
_level0.container.iNecesari: 10  ---  number
_level0.container.inamici: 0  ---  number
_level0.container.bonusMuste: 0  ---  number
_level0.container.pauza: false  ---  boolean
_level0.container.lang: eng  ---  string
_level0.container.norX: [type Function]  ---  function
_level0.container.mushte: [type Function]  ---  function
_level0.container.porumb: [type Function]  ---  function
_level0.container.balon: [type Function]  ---  function
_level0.container.peste: [type Function]  ---  function
_level0.container.lovit: [type Function]  ---  function
_level0.container.superbonus: [type Function]  ---  function
_level0.container.setPas: [type Function]  ---  function
_level0.container.: 1  ---  number
_level0.container.: 551  ---  number
_level0.container.: 455  ---  number
_level0.container.: [type Function]  ---  function
_level0.container.pointsLabel: POINTS: 0  ---  string
_level0.container.puncte: 0  ---  number
_level0.container.levelLabel: LEVEL:   ---  string
_level0.container.level: 1  ---  number
_level0.container.drops: 93  ---  number
_level0.container.endGame: _level0.container.endGame  ---  movieclip
_level0.container.nor: _level0.container.nor  ---  movieclip
_level0.container.apa: _level0.container.apa  ---  movieclip
_level0.container.lapte1007: _level0.container.lapte1007  ---  movieclip
_level0.container.peste10150: _level0.container.peste10150  ---  movieclip
_level0.container.instance5747: _level0.container.instance5747  ---  object
_level0.container.levelMC: _level0.container.levelMC  ---  movieclip
_level0.container.zuperBonus: _level0.container.zuperBonus  ---  movieclip
_level0.container.instance5744: _level0.container.instance5744  ---  movieclip
_level0.container.instance5741: _level0.container.instance5741  ---  movieclip
_level0.container.bara2: _level0.container.bara2  ---  movieclip
_level0.container.instance5734: _level0.container.instance5734  ---  movieclip
_level0.container.flashh: _level0.container.flashh  ---  movieclip
_level0.container.muste: _level0.container.muste  ---  movieclip
_level0.container.vaca: _level0.container.vaca  ---  movieclip
_level0.container.bara: _level0.container.bara  ---  movieclip
_level0.container.nor2: _level0.container.nor2  ---  movieclip
_level0.container.nor2: _level0.container.nor2  ---  movieclip
_level0.container.bgPic2: _level0.container.bgPic2  ---  movieclip