title: AS3 - iOS device UDID and IP access for Smaato integration?
body: <p>I'm building a mobile game and wanted to make it free with a banner ad on the start screen. I was going to use Smaato but it seems according to their api that they require that I pass them the UDID and the device ip in the query string. Is there anyway to do that with Actionscript 3? The code I'm using is below but it only pulls in an ad and when that ad is clicked on it points to a 2x2 gif on Smaato's servers. I got this code out of a book titled "iOS Development with Flash" and it's only a few months old. Smaato's "support" guy is not much help. Am I trying to accomplish the impossible?</p>
  
  <p>Has anyone accomplished Smaato ingratiation with AS3?</p>
  
  <pre><code>/* SMAATO Advertising Code for Start Page
  var request:URLRequest = new URLRequest("http://soma.smaato.com/oapi/reqAd.jsp");
  var variables:URLVariables = new URLVariables();
  variables.adspace = "65741799";
  variables.pub = "923842495";
  //variables.devip = "127.0.0.1"; The book had this line but it's not right so I commented it out
  variables.format = "IMG";
  variables.adcount = "1";
  variables.response = "XML";
  request.data = variables;
  var loader:URLLoader = new URLLoader();
  
  var l:Loader = new Loader();
  
  loader.addEventListener(Event.COMPLETE, onComplete);
  loader.load(request);
  
  
  function onComplete(e:Event):void
  {
      var data:XML = new XML(loader.data as String);
      var status:String = data.*::status.toString(); 
      if(status == "success")
      {
          var ad:XMLList = data.*::ads.*::ad;
          var link:String = ad.*::link.toString();
  
          var l:Loader = new Loader();
          l.load(new URLRequest(link));
          addChild(l);
          l.x = 80;
          l.y = 255;
          var clickurl:String = ad.*::action.@target.toString();
          l.addEventListener(MouseEvent.CLICK, onAdClick);
       }
  
     function onAdClick(e:MouseEvent):void
     {
         var request:URLRequest = new URLRequest(clickurl);
         navigateToURL(request);
     }
  }
  </code></pre>
  
  <p>Thanks for any help you can offer.</p>
  
  <p>Rich</p>