Jump to content
Search Community

Working with Google - tip

Sinewave test
Moderator Tag

Recommended Posts

So recently I had to build a banner campaign that would be running on google's ad network among others. Typically I use greensock for all my tweening needs, but I ran into a security problem with Google. They returned my banners citing the use of the Math.random() code was a violation of their security requirements, citing that that code is used to call malicious content and URLs.


I didn't have any Math.random() in my code, so I scanned through the green sock .as documents to find the Math.random() code and see if I could omit it without destroying the whole engine. I looked through the plugins I was using and couldn't fine it. After digging around I realized that TweenMax automatically uses a majority of the greensock plugins, so even plugins you don't use will be included. To fix this problem, open up the TweenMax.as file, and scroll down to where the plugins are listed.



It's well commented so you shouldn't have trouble finding it. Once there, just comment out the plugins you aren't using, especially the frameLabel() plugin if working with Google's ad network. This has the added benefit of reducing your file size (which makes using TweenMax eve more attractive!).


This is probably documented, and this tip is really for the flash monkeys who approach things from the designer side, with little programming background.


Flash (and Sock) on!

Link to comment
Share on other sites

  • 4 months later...

I did a search and did not in fact find any Math.random() anywhere. I assumed :roll::oops: it was in the said plugin because when I commented it out, our ads passed their security test.


Since your code is solid, I question the ad networks. As it is most of them don't allow AS3, and that has been out for what? 4 years?

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...