I don't think you are allowed to use spaces. So, make it:

listText = "<p><a href=\"asfunction:showList,webcasts\">View List</a></p>";

Instead of:

listText = "<p><a href=\"asfunction:showList, webcasts\">View List</a></p>";

----- Original Message ----- 
From: "Dennis Hart" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, December 28, 2005 10:34 AM
Subject: [Flashcoders] Is this a bug?


I was wondering if anyone else has run into this before.

I am trying to pass an argument (String) to a function via an html link in a
text field that will execute specific code based on the value of the
argument, but the argument seems to "get lost" during the evaluation.

The html reads:
listText = "<p><a href=\"asfunction:showList, webcasts\">View List</a></p>";

The function reads:

function showList(medium:String) {
    var media:String = medium;
    trace(media); // returns: webcasts
    trace(typeof(media)) // returns: string
    //var media:String = "webcasts";
    if (media == "webcasts") {
        trace("ARGUMENT PASSED");
    } else {
        trace(media + " ARGUMENT NOT PASSED"); returns: webcasts ARGUMENT
NOT PASSED
    }
}

The link triggers the function, and the "webcasts" argument get passed, but
gets lost or isn't recognized by the conditional (media == "webcasts") and
fails to the "ARGUMENT NOT PASSED" trace.

When I comment out the 'var media:String = medium;' ,  and uncomment the
'var media:String = "webcasts";', it results in 'true' and I get 'ARGUMENT
PASSED'. . .

Is this a bug or am I missing something here?

Thanks in advance for your help

Dennis
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to