0

I am trying to have a variable called myString available for a button click event. Inside that button I have something like this. click="getURL(myString);"

Right not it is displaying as an empty string. I know it is there because I can see it in my handleResultMethod. How do I need to code this to make the myString variable available for the getURL() method?

Here is my complete code on pastebin. http://pastebin.com/6NvinqYt

1 Answer 1

1

The myString variable being referenced in the button's click handler is the "global" myString variable for your entire TitleWindow subclass. However, when you set myString inside your handleResult function you're using the var declaration, which is creating a separate myString variable that is unique to the handleResult function.

Simply make the following change and you should be okay (~line 40):

var myString:String = evt.result.toString();

to

myString = evt.result.toString();
Sign up to request clarification or add additional context in comments.

1 Comment

This worked great! Thank you for taking the time to answer this Kalen. You Flex skills are outstanding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.