A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: URLRequest: forward slashes in website URL greys out rest of line like a comment

  1. #1
    Member
    Join Date
    Nov 2009
    Posts
    46

    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);
    ]

  2. #2
    Member
    Join Date
    Nov 2009
    Posts
    46

    URLRequest Error 1084 and Error 1093

    These are the errors I am getting.

    1084: Syntax error: expecting rightparen before colon.
    1093: Syntax error.

  3. #3
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    try escaping the forward slash with a back slash http:\/\/www.domain.com
    ~calmchess~

  4. #4
    Member
    Join Date
    Nov 2009
    Posts
    46

    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?

  5. #5
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    single quotes ? 'http://www.domain.com'
    ~calmchess~

  6. #6
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    i'll look it up next
    ~calmchess~

  7. #7
    Member
    Join Date
    Nov 2009
    Posts
    46

    Single quotes around URLRequest http address worked

    Using single quotes worked! Why did that work?

  8. #8
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    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
    ~calmchess~

  9. #9
    Member
    Join Date
    Nov 2009
    Posts
    46

    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center