Integration with AdControl

Jan 28, 2011 at 5:43 AM

I've tried to put the ad control from MS within a canvas that also has the main Physics Controller and the ad disappears every time.  I've also tried it in a different canvas of the Physics Controller. Is there trick to make sure the Physics Helper doesn't remove the ad?  The ad control serves ads from my other Silverlight project so I know its not a config issue.

Microsoft_Advertising_Mobile_UI:AdControl

Coordinator
Jan 28, 2011 at 1:08 PM

I use the ad control with physics helper in a couple of apps, "Free Drop" and "Paint to Life." For both of those, I place the ad control inside a parent canvas on top of the game canvas (the one with the PhysicsControllerBehavior).

I  would try subscribing to the AdControlError event and see wha the control reports... Here is my code -

            AdControl ads = new AdControl("xx", "yy", AdModel.Contextual, true);

            ads.Width = 480;

            ads.Height = 80;

            ads.SetValue(Canvas.LeftProperty, 320D);

            AdControl.TestMode = false;

            ads.AdControlError += new EventHandler<ErrorEventArgs>(ads_AdControlError);

            LayoutRoot.Children.Add(ads);

 



        void ads_AdControlError(object sender, ErrorEventArgs e)

        {

            string err = e.ErrorDescription;

        }

Jan 28, 2011 at 3:59 PM

Strange, I tried exactly that (with the canvas's), so it must be throwing an error, I'll catch that error and see what it says.

Jan 28, 2011 at 4:28 PM

Fantastic, it works.  I was setting the test mode to true (copy/paste from another project) without setting the correct values for test mode app id) and that was throwing an error.