Jester ...

Good Lord!! This is why I love Flash sooo much.

I looked at Dennis's question and thought, "A-ha. I can answer this one." Examined his code, couldn't se anything wrong, compared to similar code I generate through AS. Everything looked OK.

Not allowed to have spaces - that would have tripped me up as well, and I avoided it solely by chance.

Cheers - Miles

At 11:36 AM 12/28/2005, you wrote:

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: <flashcoders@chattyfig.figleaf.com>
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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.371 / Virus Database: 267.14.8/215 - Release Date: 12/27/2005


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to