I'm a little bit new to Actionscript, but I can't figure this one out. I've done a lot of searching on this topic and haven't found a clear answer. I've tried the following solutions that people posted online but none of them work.
All the following solutions give the error: 1120: Access of undefined property myVariable
Suggestion #1:
try {
trace(myVariable); }
catch {
trace("your variable doesn't exist"); }
Suggestion #2:
if (myVariable) {
trace("your variable exists!!"); }
else {
trace("it doesn't exist"); }
Suggestion #3:
if ( myVariable == null )
trace("your variable doesn't exist");
Suggestion #4:
if ( myVariable == undefined )
trace("your variable doesn't exist");
Like I said, I've found many forums posts and stuff online that give the above suggestions saying they will work, but they all seem to be giving me that same 1120: Access of undefined property myVariable error.
By the way, in case you are wondering why I would need to check if a variable exists or not, I'm planning on passing variables to the SWF in its URL, so I need to make sure the proper variables exist and handle the code properly if they are not passed in.