Static Actionscript code analysis possibilities

Update Nov 2018: It would appear that Structure101 (new download page) no longer has an ActionScript variant. Original answer, links outdated: Download Structure101g and select the Actionscript flavor after installing the software. I’ve confirmed that it is able to map out class level and even function call dependencies in Flex/AS3 projects, and generate a visual … Read more

What is the best way to get the minimum or maximum value from an Array of numbers?

The theoretical answers from everyone else are all neat, but let’s be pragmatic. ActionScript provides the tools you need so that you don’t even have to write a loop in this case! First, note that Math.min() and Math.max() can take any number of arguments. Also, it’s important to understand the apply() method available to Function … Read more

What is the best standard style for a toString implementation? [closed]

I think the format produced by Guava’s MoreObjects.toStringHelper() is pretty nice, but it’s mainly just good to have some consistent format that you use: public String toString() { return Objects.toStringHelper(this) .add(“prop1”, prop1) .add(“prop2”, prop2) .toString(); } // Produces “SimpleClassName{prop1=foo, prop2=bar}”

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

How to detect when a youtube video finishes playing?

This can be done through the youtube player API: http://jsfiddle.net/7Gznb/ Working example: <div id=”player”></div> <script src=”http://www.youtube.com/player_api”></script> <script> // create youtube player var player; function onYouTubePlayerAPIReady() { player = new YT.Player(‘player’, { width: ‘640’, height: ‘390’, videoId: ‘0Bmhjf0rKe8’, events: { onReady: onPlayerReady, onStateChange: onPlayerStateChange } }); } // autoplay video function onPlayerReady(event) { event.target.playVideo(); } // … 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

tech