Copy link to clipboard
Copied
For example:
var _loc_2:* = Number(this.text_control.text);
Why this is not:
var _loc_2:Number = Number(this.text_control.text); ?
What kglad said is most likely true, but the general use of asterisk is to be a wildcard, so that any variable type can come in. You can make an argument that it's sloppy programming, or that at least you're not doing as much as you could to show up compiler errors. But here's one example:
Suppose you want to let the user skip the loading of something, but if they don't skip things will proceed once the item is loaded. You might have something like this:
loader.addEventListener(Event.COMPLETE,proc
...Copy link to clipboard
Copied
it means someone decompiled a fla (and the variable type isn't specified)
the reason, your decompiler goofed.
Copy link to clipboard
Copied
Variable type is specified (Number), but decompiler replaced this word by "*". Why and what does it mean ? That variable was declared inside function. In case of global variables the word "Number" was not replaces by "*".
Copy link to clipboard
Copied
What kglad said is most likely true, but the general use of asterisk is to be a wildcard, so that any variable type can come in. You can make an argument that it's sloppy programming, or that at least you're not doing as much as you could to show up compiler errors. But here's one example:
Suppose you want to let the user skip the loading of something, but if they don't skip things will proceed once the item is loaded. You might have something like this:
loader.addEventListener(Event.COMPLETE,proceed);
skipBtn.addEventListener(MouseEvent.CLICK,proceed);
One of those is a mouse event the other is just an event. In this case you could have:
function proceed(e:Event){
//go on to next thing
}
because MouseEvent is still Event. The other way to solve it would be:
function proceed(e:*){
//go on to next thing
}
As I said, this isn't necessarily a good way to work, but you have the option of doing it that way.
Copy link to clipboard
Copied
Yes, asterix is a wildcard. By why the word "Number" was replaced by asterix ? And why only in case of variable declared inside function ?
And the decompiler changed also name of variable. That was not "_loc_2" but "liczba":
var liczba:Number = ...
Copy link to clipboard
Copied
The variable type is used during compiling. It's not needed in the final file, so the decompiler won't know what it is. Also, local variables get shortened. They're not needed outside of the function, so some space can be saved by giving it the shortest unique name it can have.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now