SHOW:
|
|
- or go back to the newest paste.
| 1 | - | private var test:String="hello"; |
| 1 | + | package; |
| 2 | import flash.display.MovieClip; | |
| 3 | - | function blah() |
| 3 | + | import flash.Lib; |
| 4 | ||
| 5 | - | var me = this; |
| 5 | + | class Main extends MovieClip |
| 6 | {
| |
| 7 | - | tf.name="test" |
| 7 | + | var test:String; |
| 8 | public function new() | |
| 9 | - | tf.addEventListener(Event.CHANGE, function(event) |
| 9 | + | |
| 10 | super(); | |
| 11 | - | var id = e.currentTarget.name; |
| 11 | + | test = "hello world"; |
| 12 | - | trace(untyped me[id]); // cannot create property 0 on Main (Did it cast to int because of array access?? :s) |
| 12 | + | |
| 13 | - | |
| 13 | + | var s = "test"; |
| 14 | - | var id:String = e.currentTarget.name; |
| 14 | + | |
| 15 | - | trace(untyped me[id]); //hello |
| 15 | + | trace(untyped this[s]); //hello world |
| 16 | - | }); |
| 16 | + | foo(s); // String should be Int, For function argument 's' |
| 17 | } | |
| 18 | function foo(s):Void | |
| 19 | {
| |
| 20 | trace(untyped this[s]); | |
| 21 | } | |
| 22 | public static function main() | |
| 23 | {
| |
| 24 | Lib.current.addChild(new Main()); | |
| 25 | } | |
| 26 | } |