By the way, if I declare the var for the return value in frame 1 as code, can I get it in frame 2 as code? or I need to pass it to frame 2 as code?

Because the return value needs to be re-used across several frames' as code.