|
-
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.
-
Senior Member
try escaping the forward slash with a back slash http:\/\/www.domain.com
-
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?
-
Senior Member
single quotes ? 'http://www.domain.com'
-
Senior Member
-
Single quotes around URLRequest http address worked
Using single quotes worked! Why did that work?
-
Senior Member
well i don't know exactly why single quotes worked has somthing to do with single quotes is the most primitive type of string you can create.....i suspect you aren't using an american keyboard and didn't have a quote to begin with you had something else. don't know the name of the name of other type of quote on keyboard
-
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|