I'm new at as3, maybe thats the reason why i don't understand, why the setInterval
causes an error.
<mx:Script>
<![CDATA[
import flash.utils.setInterval;
import mx.controls.Alert;
[Bindable]
public var MyInt:int = 500;
setInterval(function():void{ ++MyInt; },1000);
]]>
</mx:Script>
I have a label where the value of MyInt
gets visible, the bind works perfect, i've tested it several ways, and i i create a button it grows the number, but if i use the setInterval
function i get an error: Access of undefined property myInt
.
Why? What does cause this? Please explain it, so I can avoid errors like this. Thanks