#!/bin/shThe script initially does the same as the one in the previous post, but sets -debug to true. When the flash debug player runs it outputs data to a log file. This file is called flashlog.txt and is stored in ~/.macromedia/Flash_Player/Logs/ by default on linux. The script runs through lines in the trace output and echos them to the console one at a time. When it notices that the flash player is closed, it exits and when it reaches the last available line it stops tracing. It does in fact work (although there is a bit of latency as debugger writes to file -> is read by script isn't instantaneous). It may not be great for things like ENTER_FRAME events, and current mouse position, but it is enough for me. Just install it in the same way as I did in the previous post and set a key-shortcut like control-alt-d for debugging.
EHOME=`echo $HOME | sed "s/#/\#/"`
DIR=$GEDIT_CURRENT_DOCUMENT_DIR
FILE=$GEDIT_CURRENT_DOCUMENT_NAME
EXT='swf'
echo "Compiling: " $GEDIT_CURRENT_DOCUMENT_PATH
echo '--------------------'
SWF=${FILE%as}${EXT}
cd ${DIR%${FILE}} > /dev/stderr
export PATH=/home/experimentalized/developer/sdks/flex_sdk/bin:$PATH
mxmlc -debug=true -static-link-runtime-shared-libraries=true ${FILE}
gnome-open ${SWF}
echo "Waiting for Flash Player to connect"
sleep 4
OUTPUTDIR=/home/experimentalized/.macromedia/Flash_Player/Logs/flashlog.txt
TOTALLINES=`sed -n '$=' ${OUTPUTDIR}`
LINE=1
CURRENT=`sed -n "${LINE}{p;q}" ${OUTPUTDIR}`
while [ "true" ]
do
if ps ax | grep -v grep | grep flashplayerdebugger > /dev/null
then
TOTALLINES=`sed -n '$=' ${OUTPUTDIR}`
if [ "$TOTALLINES" -ge "$LINE" ]; then
CURRENT=`sed -n "${LINE}{p;q}" ${OUTPUTDIR}`
LINE=$(( $LINE + 1 ))
echo ${CURRENT}
fi
else
break
fi
done
exit 0
I think I'm finally happy with my flash setup on Linux which is great (although code completion isn't there so I may take a look into that). Here are some screenshots: