Unreachable, existing variable
Posted
by Oden
on Stack Overflow
See other posts from Stack Overflow
or by Oden
Published on 2010-06-13T13:09:01Z
Indexed on
2010/06/13
13:22 UTC
Read the original article
Hit count: 181
flex
|actionscript-3
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
© Stack Overflow or respective owner