getURL() not working as expected

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default getURL() not working as expected

    Hello,

    We have a requirement where homepage of the site will be specific to a
    country. When a first time user navigates to the site(say, [url]www.abc.com[/url]),
    he/she will select country from the list of countries and he/she will be
    navigated to the homepage of that country([url]www.abc.com/countryx[/url]). This means
    that repeat user will get the homepage of countryx when the user types
    [url]www.abc.com[/url]. I am trying to achieve this through the code attached but the call
    to getURL() is not working.

    Any help will be greatly appreciated.

    Thanks,

    Ruchir

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" width="1449"
    height="602"
    initialize="saveInfo()">

    ...
    ...
    ...

    function saveInfo() {
    userSelectedItem=SharedObject.getLocal("ComboCBS") ;
    if (userSelectedItem==null)
    {
    mx.controls.Alert.show("Cannot create shared object",
    "Error");
    }
    else {
    if (userSelectedItem.data.name!=undefined)
    CombCB.selectedIndex=userSelectedItem.data.name;
    cntry = userSelectedItem.data.name;

    if (cntry==1) {
    getURL('http://localhost:8700/flex/Technical_Information.htm','_blank');
    }
    }
    }

    ruchir123 Guest

  2. Similar Questions and Discussions

    1. onDisconnect not working as expected on IE7
      I have an application for a poker game which works perfectly in Firefox 1.5 and 2.0, however in IE7 (not too sure about IE6 thou) there is a serious...
    2. I need help please with the getURL() it is not working.
      I was able to make this work in the earler ver. of Flash. But when the movie ends it will not goto the url that I am telling it to goto. Is there...
    3. setStyle() not working as expected
      Hello, I have a need when a mouse pointer hovers over a vbox container, the backgroundColor property should be changed to a gray color and when...
    4. getURL taregt not working ...PLEASE HELP
      Hello, I am working on a flash front end for a web based app (ColdFusion is the app server) and I have a "getURL" link with a target. The problem...
    5. getUrl and javascript now working in a frame
      Hey, I have a flash page that uses getUrl to call a javascript function that is on the same html page. When I load this html page all on it's own,...
  3. #2

    Default Re: getURL() not working as expected

    The call to 'http://localhost:8700/flex/Technical_Information.htm' is not
    working? First try putting that as the event handler of a button and see what
    happens when you press the button:

    <mx:Button label="Test"
    click="getURL('http://localhost:8700/flex/Technical_Information.htm')" />

    Post any error messages you are getting. Make sure you can also reach this
    same page in a browser without going through Flex.

    peterent Guest

  4. #3

    Default Re: getURL() not working as expected

    Hello Peter,

    I have replaced the technical_information.htm with "usa.mxml" in the code
    example i have pasted in original posting. Now something strange is happening.

    If I invoke following URL from Internet Explorer it works just fine. It also
    works fine from flex.

    [url]http://localhost:8700/flex/usa.mxml[/url]

    however if I invoke this one(mentioned below). It will show me an error. This
    also does NOT work from flex.

    [url]http://localhost:8700/flex/uk.mxml[/url]

    There is absolutely no difference between two mxml file layout and design.

    The error it showes for uk.mxml
    =============================================
    The page cannot be found
    The page you are looking for might have been removed, had its name changed, or
    is temporarily unavailable.


    --------------------------------------------------------------------------------

    Please try the following:

    If you typed the page address in the Address bar, make sure that it is spelled
    correctly.

    Open the localhost:8700 home page, and then look for links to the information
    you want.
    Click the Back button to try another link.
    Click Search to look for information on the Internet.



    HTTP 404 - File not found
    Internet Explorer

    ---------------


    ruchir123 Guest

  5. #4

    Default Re: getURL() not working as expected

    I forgot to mention that both mxml files are physically located in the same folder.

    Thank you.

    Ruchir
    ruchir123 Guest

  6. #5

    Default Re: getURL() not working as expected

    The only reason you should get a 404 is that the file is not on the server. It may be in your working folder, but you probably forgot to push it to the server.
    peterent Guest

  7. #6

    Default Re: getURL() not working as expected

    Thanks Peter,

    Actually all files were located under same folder, however, I did not "build"
    mxml pages for uk.mxmi after designing it. I was simply calling it thru my
    homepage. After I ran build process on the uk.mxml, it worked just fine.

    Thank you very much for your help.

    Ruchir

    ruchir123 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139