2 Replies Latest reply on Jan 12, 2007 11:41 AM by digunder

    Using query strings works on every browser except IE7

    digunder
      I made this file to pass the variables through the url and then use aps or java to append the variables either to the flashvars in ex: <param name="flashvars" value="'+document.location.search+'" or to the filename in ex: <embed src="swf/cpk_prod_kids.swf'+document.location.search+'" width="544" height="397" Both methods work on all browsers EXCEPT IE7 ???? below is all the Actionscript in the file: in advance thanks for any and all help!!!!

      //
      // variables to hold common info....
      aspPage = "cpk_prod_kids.aspx?";
      sectionNSub ="&section=products&subs=mtcs";
      //watch the commercial link...
      wtcLink = " http://www.playalongtoys.com";
      // Product array *******************************************************
      //change values to store each file name / location. Add to the array as needed.
      prod_a = new Array;
      prod_a[0] = "productSWF/1.swf";// number of products in array. This feature is currently unused....
      prod_a[1] = "productSWF/1.swf";
      prod_a[2] = "productSWF/2.swf";
      prod_a[3] = "productSWF/3.swf";
      prod_a[4] = "productSWF/4.swf";
      prod_a[5] = "productSWF/5.swf";
      prod_a[6] = "productSWF/1.swf";
      prod_a[7] = "productSWF/2.swf";
      prod_a[8] = "productSWF/3.swf";
      prod_a[9] = "productSWF/4.swf";
      prod_a[10] = "productSWF/5.swf";
      prod_a[11] = "productSWF/1.swf";
      prod_a[12] = "productSWF/2.swf";
      //
      //sets the dynamic text
      dt = new Array;
      dt[0] = 1;
      dt[1] = "this is text1";
      dt[2] = "this is text 2";
      dt[3] = "Lorem ipsum dolor sit amet, ";
      defaultText = "this is the standard text, either the correct text has not loaded or will load in a moment";
      //
      // button functions ****************************************************
      button_mc.button1_but.onPress = function()
      {
      getURL(aspPage+"p=1","_self");
      }
      button_mc.button2_but.onPress = function()
      {
      getURL(aspPage+"p=2","_self");
      }
      button_mc.button3_but.onPress = function()
      {
      getURL(aspPage+"p=3","_self");
      }
      button_mc.button4_but.onPress = function()
      {
      getURL(aspPage+"p=4","_self");
      }
      button_mc.button5_but.onPress = function()
      {
      getURL(aspPage+"p=5","_self");
      }
      button_mc.button6_but.onPress = function()
      {
      getURL(aspPage+"p=6","_self");
      }
      button_mc.button7_but.onPress = function()
      {
      getURL(aspPage+"p=7","_self");
      }
      button_mc.button8_but.onPress = function()
      {
      getURL(aspPage+"p=8","_self");
      }
      //
      //
      //**********************************************************************************
      // DO NOT EDIT BELOW THIS LINE THERE IS NO REASON YOU SHOULD HAVE TO !!!!!! *
      //**********************************************************************************
      //
      onLoad = function()
      {
      productState();
      description();
      moveScroller();
      }
      onEnterFrame = function()
      {
      moveScroller();
      }
      //
      function productState()
      {
      p = parseInt(p, 10); // parses the string "1" to a integer 001 ( 10 = base 10)
      if( p >0) // if p = 0 then it defaults to the else statement below
      {
      loader_mc.loadMovie(prod_a[p]); // places the parsed value of "p" in the selection for the array
      }
      else
      {
      loader_mc.loadMovie(prod_a[1]); // default product to load.
      }
      // calculates the necessarry movement of the scroller when the page refreshes...
      numItems = .25;
      movement= p*numItems;
      pDivided = p/4;
      neededMove = parseInt(pDivided, 10);
      if (movement> neededMove)
      {
      A= parseInt(movement, 10);
      //A= A-1;
      leftMove(281* A);
      }
      else if (movement = neededMove)
      {
      A= parseInt(movement, 10);
      A= A-1;
      leftMove(281* A);
      }
      delete p; // deletes the var, if it is left in 2 p variables will be passed and the application won't work.
      }
      // end Load logic **************************************************
      function moveScroller()
      {
      // generates temp vars to hold basic information and makes it easier to change later if necessary.
      tempA = button_mc._width;
      tempB = button_mc._x; // distance traveled where it started - how far it moved
      tempC = 168.5;
      tempD = tempB - 446.5; // distance traveled where it started - how far it moved - initial position and its length.
      tempE = tempC - tempA; // where it started - total length
      // Below actuates the buttons on the Left side of the screen.
      if(button_mc._x > 160)
      {
      aRight_but._visible=false;
      aRight_mc._visible=false;
      aRight_mc._alpha=0;
      }
      else
      {
      aRight_but._visible=true;
      aRight_mc._visible=true;
      aRight_mc._alpha=100;
      }
      // below statements make the button on the right actuate
      if(tempE < tempD)
      {
      aLeft_but._visible=true;
      aLeft_mc._visible=true;
      aLeft_mc._alpha=100;
      }
      else
      {
      aLeft_but._visible=false;
      aLeft_mc._visible=false;
      aLeft_mc._alpha=0;
      }
      wtcDisplay();
      }
      // script to move the scroll left or right ********************************
      aLeft_but.onPress = function ()
      {
      leftMove(281);
      }

      aRight_but.onPress = function ()
      {
      if(button_mc._x < 169)
      {
      if( button_mc._width >= (button_mc._width-281))
      {
      rightMove(281);
      }
      }
      }
      //
      function leftMove(distance)
      {
      button_mc._x = (button_mc._x - distance);
      }
      function rightMove(distance)
      {
      button_mc._x = (button_mc._x + distance);
      }
      //
      // watch the commercials button ****************************************
      wtc_mc.wtc_but.onPress = function()
      {
      getURL(wtcLink,"_blank");
      }
      function description()
      {
      d = parseInt(d, 10);
      if(d>0)
      {
      dynamicText = dt[d];
      }
      else
      {
      dynamicText = defaultText;
      }
      }
      function wtcDisplay()
      {
      if(wtc == "yes")
      {
      _root.wtc_mc._visible = true;
      _root.wtc_mc._alpha = 100;
      }
      else
      {
      _root.wtc_mc._visible = false;
      _root.wtc_mc._alpha = 0;
      }
      }

      // obligitory stop command.
      stop();