How to make use of play2() function in order to perform fast stream switching of videos?

As the Documentation says: “The default value of offset is -1, which defaults the switching behavior to standard. In this mode, the server determines a good transition point between the streams forward in time from the point it receives the switch call, and switches at that point.” So you have to change the ‘offset’ parameter … Read more

SQLStatement.execute() – multiple queries in one statement

I wound up using this. It is a kind of a hack, but it actually works pretty well. The only thing is you have to be very careful with your semicolons. : D var strSql:String = stream.readUTFBytes(stream.bytesAvailable); var i:Number = 0; var strSqlSplit:Array = strSql.split(“;”); for (i = 0; i < strSqlSplit.length; i++){ NonQuery(strSqlSplit[i].toString()); }

What are the major performance hitters in AS3 aside from rendering vectors?

Documents I’ve found helpful are: Optimizing Performance for the Adobe Flash Platform ActionScript 3.0 and AVM2 Performance Tuning by Gary Grossman Building High Performance iPhone Applications by Mike Chambers Some highlights: Choose appropriate display objects One of the most simple optimization tips to limit memory usage is to use the appropriate type of display object. … Read more

Calculate Bounding box coordinates from a rotated rectangle

Transform the coordinates of all four corners Find the smallest of all four x’s as min_x Find the largest of all four x’s and call it max_x Ditto with the y’s Your bounding box is (min_x,min_y), (min_x,max_y), (max_x,max_y), (max_x,min_y) AFAIK, there isn’t any royal road that will get you there much faster. If you are … Read more

Call AngularJS from legacy code

Interop from outside of angular to angular is same as debugging angular application or integrating with third party library. For any DOM element you can do this: angular.element(domElement).scope() to get the current scope for the element angular.element(domElement).injector() to get the current app injector angular.element(domElement).controller() to get a hold of the ng-controller instance. From the injector … Read more

What is the best way to stop people hacking the PHP-based highscore table of a Flash game

This is a classic problem with Internet games and contests. Your Flash code works with users to decide a score for a game. But users aren’t trusted, and the Flash code runs on the user’s computer. You’re SOL. There is nothing you can do to prevent an attacker from forging high scores: Flash is even … Read more