Hi all, I've scoured around looking for a solution to this problem, but I cannot ascertain why the code for one set of navigation buttons I've created works, but similar code does not. The code is rather lengthy, but I've pulled out the salient components to see if the Interwebs could help.
I'm new, so I'm not even sure I'm framing the question properly (read: be gentle), but I'd really appreciate the help.
Here's the script that IS working:
Listener code:
And the function code that goes with it:Code:cswordbutton.addEventListener(MouseEvent.CLICK,fetchcswordassets);
And here's a snippet of code that isn't working:Code:function fetchcswordassets(e:MouseEvent):void{ var url:String = "knowntomeURL"; var request:URLRequest = new URLRequest(url); try { navigateToURL(request, '_blank'); } catch (e:Error) { trace("Error occurred!"); } }
Listener Code:
Function Code:Code:commwordbutton.addEventListener(MouseEvent.CLICK,fetchcommwordassets);
Other (potentially useful) clues:Code:function fetchcommwordassets(e:MouseEvent):void{ var url:String = "knowntomeURL2"; var request:URLRequest = new URLRequest(url); try { navigateToURL(request, '_blank'); } catch (e:Error) { trace("Error occurred!"); } }
1) All of the actions are in a separate layer in the first frame;
2) There is only one scene;
3) I've given the same button a different instance name in many cases, to coincide with different expectations (URLs).
Can anyone lend a hand to a complete *******?




Reply With Quote