-1

Sorry for simple question, but...

I have DocumentClass which has public variable kTemp:

public var kTemp:Number = 0;

I Also have Movie Clip which has some internal timeline code with this fragment:

var counter1:int = 0;  
counter1 = kTemp;

Strangely enough, but the last line gives an error:

1120: Access of undefined property kTemp. counter1 = kTemp

What am I doing wrong?

I though that global variables are seen from everywhere.
What is the simplest method to get value of public variable inside movie clip?

leppie
  • 115,091
  • 17
  • 196
  • 297
Fogflasher
  • 11
  • 1
  • 5

1 Answers1

0

Using google I found only this decision which works in my case:

var _root=MovieClip(root);
var counter1:int;
counter1 = _root.kTemp;  

I also tried the combo: var public static + Classname.variable, but it doesn't work (Error: something like unknown property of class)...

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
Fogflasher
  • 11
  • 1
  • 5