URLRequest: forward slashes in website URL greys out rest of line like a comment
After the double forward slashes in the website address, the rest of the line gets greyed or commented out in the Script Pane. How come?
[
function gotoSoccerSite(evtObject:MouseEvent):void {
var soccerURL:URLRequest = new URLRequest (“http://www.usyouthsoccer.org/”);
navigateToURL(soccerURL);
}
function gotoSoftballSite(evtObject:MouseEvent):void {
var softballURL:URLRequest = new URLRequest (“http://www.softball.org/”);
navigateToURL(softballURL);
}
function gotoAllianceSite(evtObject:MouseEvent):void {
var allianceURL:URLRequest = new URLRequest (“http://www.nays.org/”);
navigateToURL(allianceURL);
}
soccer_btn.addEventListener(MouseEvent.CLICK, gotoSoccerSite);
]
URLRequest Error 1084 and Error 1093
These are the errors I am getting.
1084: Syntax error: expecting rightparen before colon.
1093: Syntax error.
Still getting same error messages even using escape character
I am still getting the same error messages even after using escape character on the two forward slashes, then also using it on the colon, then also using it on the last forward slash at the end of the website address. Any other ideas?
Single quotes around URLRequest http address worked
Using single quotes worked! Why did that work?
Copied and Pasted Code from Microsoft Word
Yes, you are right! I copied and pasted the code from Microsoft Word. When I put back the double quotes it worked fine. I actually knew this and forgot NEVER to paste anything from Microsoft Word. Thank you SO much.