A colleague just came across a problem with a Flash banner when uploading it to Google AdWords.
The banner contained an effect where many movie clips were randomly generated and positioned. Yet when uploaded to Google AdWords, an error occurred stating that random numbers could not be used.
The problem is with Math.random, Google AdWords doesn't allow it. We called the AdWords help desk and they confirmed that Math.random cannot be used, but were unable to give a reason why.
Is this a security hole in Flash? LiveDocs say Math.random is "calculated in an undisclosed manner", so does it use the client hardware to generate that number? I'm now intrigued, if anyone can shed some light on this please comment.
07 November 2007
Google AdWords and Math.random
Posted by
Dan Lavender
at
9:52 AM
Subscribe to:
Post Comments (Atom)
2 comments:
Yes it does. The RAM Size, the CPU Banwith (MHz/GHzit operates on), the Clock/Bus-speed all determine the speed, accuracy, correctness, randomness and preciseness of a random number. This means if you have the fastest PC in the world (or over-clocked your current one with liquid-nitrogen to 5+GHZ) will get a more accurate and greater or lower number depending on the way a Math.random is used. (exp.: Math.random()*10 vs. Math.random()*-10).
As to why Google not allows is, according to what I know, it would interfere with Google's handling of their AdSense scripts (the script a user incorporates in his/her website, and display your ads and/or any RANDOM generated relevant ads based on the sites content)
Here's a guess. Some old version of the flash player implements random by reading from preset locations in the client's memory. It is probably a security problem.
Post a Comment