When I was saving pico's school.swf to my computer, I decided " hey, wouldn't it be funny if I made this a .fla file?" so I opened my flash decompiler and took a look at the flash.
When I opened it and I saw the medal icon, and another box that connects to the medal points.
First, i looked at the actionscript for the other box. It read:
setProperty("", _visible, false);
var checkConnection = function (event)
{
if (!event.success)
{
setProperty("", _visible, true);
gotoAndStop(3);
} // end if
};
if (com.Newgrounds.NewgroundsAPI.isNewgroun ds() || _root.API_Settings.debug_mode)
{
com.Newgrounds.NewgroundsAPI.addEventLis tener(com.Newgrounds.NewgroundsAPI.event s.MOVIE_CONNECTED, checkConnection);
if (!com.Newgrounds.NewgroundsAPI.hasUserSe ssion() && !_root.API_Settings.debug_mode)
{
setProperty("", _visible, true);
gotoAndStop(2);
} // end if
} // end if
com.Newgrounds.NewgroundsAPI.setMovieVer sion(_root.API_Settings.movie_version);
com.Newgrounds.NewgroundsAPI.connectMovi e(_root.API_Settings.movie_id, _root.API_Settings.enc_key, _root.API_Settings.debug_mode);
com.Newgrounds.NewgroundsAPI.loadMedals(
);
stop ();
Then i checked the first frame of the actions layer for the medal box:
function unlockMedal(m_name)
{
clearInterval(pop_delay);
var _loc1 = com.Newgrounds.NewgroundsAPI.getMedals()
;
var _loc2 = null;
for (i in _loc1)
{
if (_loc1[i].medal_name == m_name)
{
_loc2 = _loc1[i];
medal_name = _loc2.medal_name;
medal_value = _loc2.medal_value + "pts";
com.Newgrounds.NewgroundsAPI.unlockMedal (medal_name);
pop_delay = setInterval(endDelay, 3000);
setProperty("", _visible, true);
gotoAndPlay(2);
break;
} // end if
} // end of for...in
} // End of the function
function endDelay(params)
{
gotoAndPlay(10);
clearInterval(pop_delay);
} // End of the function
var pop_delay;
var medal_name = "?????";
var medal_value = "???";
setProperty("", _visible, false);
After that came the animation of the medal appearing followed by a last actionscript for the final frame:
var myBitmapData = flash.display.BitmapData.loadBitmap(meda l_name + ".gif");
medal_icon.attachBitmap(myBitmapData, 111);
stop ();
Do you think we can exploit this for the general use of medals?