3 Replies Latest reply on Jun 29, 2006 8:07 AM by Newsgroup_User

    LoadVars Working Within Flash Fine But Not on Webhost

    Mike122699
      Hello Everyone,

      I have created the following code below. It is basically pulling a delayed stock quote and placing it on a shockwave file. When I test movie within flash it works fine. When I place it on a webhost it doesn't put the variables don't appear at all. I am completely puzzled by this. Does anyone know why this is happening? Please see my code below. Place this code onto frame one and create 5 dynamic text fields; hey, hey1, hey2, hey3, hey4. It will work locally but if you upload to a server it wont work. Why??????????????
        • 1. Re: LoadVars Working Within Flash Fine But Not on Webhost
          Level 7
          Looks like a cross-domain policy issue.

          http://livedocs.macromedia.com/flash/8/main/00001616.html

          --
          Lon Hosford
          www.lonhosford.com
          Flash, Actionscript and Flash Media Server examples:
          http://flashexamples.hosfordusa.com
          May many happy bits flow your way!
          "Mike122699" <webforumsuser@macromedia.com> wrote in message
          news:e7un9n$49d$1@forums.macromedia.com...
          > Hello Everyone,
          >
          > I have created the following code below. It is basically pulling a
          > delayed
          > stock quote and placing it on a shockwave file. When I test movie within
          > flash
          > it works fine. When I place it on a webhost it doesn't put the variables
          > don't
          > appear at all. I am completely puzzled by this. Does anyone know why
          > this is
          > happening? Please see my code below. Place this code onto frame one and
          > create 5 dynamic text fields; hey, hey1, hey2, hey3, hey4. It will work
          > locally but if you upload to a server it wont work. Why??????????????
          >
          >
          > csv_lv = new LoadVars();
          > csv_lv.onLoad = function(successful) {
          > for (var prop in this) {
          > if (typeof this[prop] != "function") {
          > if (this[prop] == "") {
          > var t = prop.split(",");
          > }
          > }
          > }
          > for (var i=0; i<t.length; i++) {
          > t = removeQuotes(t);
          > hey.text = t[0];
          > hey1.text = t[1];
          > hey2.text = t[2];
          > hey3.text = ampm(t[3]);
          > hey4.text = t[4];
          >
          >
          > if(t[4].charAt(0) == '-') {
          > myTextFormat = new TextFormat();
          > myTextFormat.color = 0x990000;
          > hey4.setTextFormat(myTextFormat);
          > }else{
          > myTextFormat = new TextFormat();
          > myTextFormat.color = 0x009933;
          > hey4.setTextFormat(myTextFormat);
          > }
          >
          > }
          > }
          > csv_lv.load(" http://finance.yahoo.com/d/quotes.csv?s=SIRI&f=sl1d1t1c1");
          >
          >
          > function removeQuotes(theString) {
          > if(theString.charAt(0) == '"' || theString.charAt(0) == "'") {
          > return theString.substr(1, theString.length - 2);
          > }else{
          > return theString;
          > }
          > }
          >
          > function ampm(theString) {
          > if(theString.substr(theString.length - 2, theString.length) == "am") {
          > return theString.substr(0, theString.length - 2) + " AM";
          > }else{
          > return theString.substr(0, theString.length - 2) + " PM";
          > }
          > }
          >


          • 2. Re: LoadVars Working Within Flash Fine But Not on Webhost
            Mike122699 Level 1
            But I am using Flash 6.0 (MX). The documentation you referred me to is for flash 7.0 and up. But as I'm reading it, it does sound like whats happening with me. I am just taking a stock quote from Yahoo Finance. How do make it a comparable domain if I'm taking it from Yahoo Finance?
            • 3. Re: LoadVars Working Within Flash Fine But Not on Webhost
              Level 7
              "In files published for Flash Player 6, you could use the
              LocalConnection.allowDomain handler or System.security.allowDomain() method
              to specify permitted cross-domain access (for example, to let a file at
              someSite.com be accessed by a file at someOtherSite.com), and no command was
              needed to permit subdomain access (for example, a file at www.someSite.com
              could be accessed by a file at store.someSite.com)."
              http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=0000161 7.html#239106

              I
              --
              Lon Hosford
              www.lonhosford.com
              Flash, Actionscript and Flash Media Server examples:
              http://flashexamples.hosfordusa.com
              May many happy bits flow your way!
              "Mike122699" <webforumsuser@macromedia.com> wrote in message
              news:e80im9$bnq$1@forums.macromedia.com...
              > But I am using Flash 6.0 (MX). The documentation you referred me to is
              > for
              > flash 7.0 and up. But as I'm reading it, it does sound like whats
              > happening
              > with me. I am just taking a stock quote from Yahoo Finance. How do make
              > it a
              > comparable domain if I'm taking it from Yahoo Finance?
              >