Ryan, If you use the popup capabilities in Flex Viewer 2.3.1 than I don't think that the code is needed.Here is an example of how to use the louisville traffic cameras://Main config.xml under operational layers
<layer label="Traffic Cameras" type="feature" visible="true" alpha="1"
popupconfig="popups/PopUp_Traffic_Cameras.xml"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2"/>
//new PopUp_Traffic_Cameras.xml to be added to the popups folder<?xml version="1.0" ?>
<configuration>
<title>{DESCRIPTION}</title>
<fields>
<field name="DESCRIPTION"/>
<field name="ONLINE"/>
<field name="LAST_UPDATED"/>
<field name="URL"/>
</fields>
<medias>
<media type="image" caption="Latest Image {LAST_UPDATED} online: {ONLINE}" imagesource="{URL}" imagelink="{URL}"/>
</medias>
</configuration>
<!--
Pop-up configuration file for:
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2
-->