0 Replies Latest reply on May 5, 2011 12:23 PM by NancyJanetKing

    I HATE CS5!! urlVariables Problem

    NancyJanetKing

      First up, CS5 should be called the bug release because it's nothing but pure bugs! I've wasted days working around the stupid problems this release continually causes me. Now, it's crashed one of my sites because urlVariables that worked before, after fixing something else and creating a new swf, are now broken. Lovely. Thank you Adobe. Glad you're making money. Hope you consider us programmers next time you release some garbage.

       

      Here's my code:

       

      package com.elcandelon.store

      {

      import flash.display.Sprite;

      import flash.events.*;

      import flash.text.*;

      import flash.net.*;

      import RegExp;

       

      public class PrepData extends Sprite {

      private var url:String = new String();

      private var store:String = new String();

      private var cat:String = new String();

      private var loader:URLLoader = new URLLoader();

       

      public function PrepData(_whichPage:String, _store:String, _cat:String)

      {

      store = _store;

      cat = _cat;

      url = "flash_store.py";

      var req:URLRequest = new URLRequest(url);

      var variables:URLVariables = new URLVariables();

      loader.dataFormat = URLLoaderDataFormat.VARIABLES;

      req.method = URLRequestMethod.POST;

      variables.store = "products";

      variables.cat = "qqq";

      req.data = variables;

      loader.load(req);

      loader.addEventListener(Event.COMPLETE, onSendComplete);

      }

       

      private function onSendComplete(e:Event):void

      {

      var txt:TextField = new TextField();

      var myFormat:TextFormat = new TextFormat();

      myFormat.font = "Arial";

      myFormat.size = 12;

      var str:String = new String(e.target.data);

      var tf:TextField = new TextField();

      var f:TextFormat = new TextFormat();

      f.font = "Arial";

      f.size = 12;

      tf.width = 400;

      tf.wordWrap = true;

      tf.htmlText = str;

      tf.x = 0;

      tf.y = 0;

      tf.autoSize = TextFieldAutoSize.LEFT;

      tf.setTextFormat(f);

      addChild(tf);

      loader.removeEventListener(Event.COMPLETE, onSendComplete);

      }

      }

      }

      This code doesn't send the variables. I have to "fake it" in my python script, then I do get the data back (oh, but NOT in a way that I can separate out variables, or split strings into arrays that I can use, etc, etc...I hate Adobe for this release.) So how do I work around the bug-ridden garbage called CS5 to get my variables properly sent off?
      TIA,
      Nancy