A
A
Andrey2018-06-13 09:51:17
ActionScript
Andrey, 2018-06-13 09:51:17

How to pull value from Actionscript 3 function?

Such a question I am in this almost zero:

function loadraznusd(event:Event):void{
raznusd.text = my_loadraznusd.data;
trace (my_loadraznusd.data)
}

So it returns the number 0, as it should be, it also displays it in the video ...
function loadraznusd(event:Event):void{
raznusd.text = my_loadraznusd.data;
}
trace (my_loadraznusd.data)

So it produces undefined, I understand why. But how to pull it out of the function?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
illuzor, 2018-06-13
@iLLuzor

The load event is asynchronous. In the first example, you access the variable after loading, in the second - before loading. That is, in the second case, you are trying to access the data variable, which does not yet exist (did not have time to load)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question