Hey, I love your simple carousel menu, but I cant seem to get it to actually click thru to anything!
Code:
function mouseDownListener(e:MouseEvent):void
{
var clip1_mcURL:String = "http://www.google.com"
var clip2_mcURL:String = "http://www.google.com"
var clip3_mcURL:String = "http://www.google.com"
var clip4_mcURL:String = "http://www.google.com"
var clip5_mcURL:String = "http://www.google.com"
var clickthru:URLRequest = new URLRequest(e.target.name+"URL");
navigateToURL(clickthru);
trace(e.target.name + " was pressed.");
}
the trace action works fine, but the clickthru always passes "clip1_mcURL" instead of the URL. what am I doing wrong?
The code doesn't do what you want because you're mixing variable names and strings. To be specific, the statement
Try this instead.
var clip1_mcURL:String = "http://www.google.com" var clip2_mcURL:String = "http://www.google.com" var clip3_mcURL:String = "http://www.google.com" var clip4_mcURL:String = "http://www.google.com" var clip5_mcURL:String = "http://www.google.com" function mouseDownListener(e:MouseEvent):void { var clickthru:URLRequest = new URLRequest(this[e.target.name+"URL"]); navigateToURL(clickthru); trace(e.target.name + " was pressed. URL is " + clickthru.url); }HTH.
And I'm glad you like the Carousel. Thanks
Gus (Asset Author)