Debugging SWF files for use with SWFRenderer

42 views
Skip to first unread message

karim beyrouti

unread,
Feb 2, 2015, 5:49:32 AM2/2/15
to
To help content creators and developers debug their SWF files, I have created an AIR project / app with source code which will load SWF files much like SWF Renderer does. 
This should (hopefully) help developers debug their applications, and help solve issues SWF Renderer might have with your content.

This project can be used in debug mode to help find any issues, the source can be found here:

bac...@gmail.com

unread,
Feb 5, 2015, 11:55:49 AM2/5/15
to swfre...@googlegroups.com
great help thanks.

discovered for some reason the following on the timeline throws a runtime error in SWF Renderer

import com.greensock.*;


TweenLite.to(marquee,12,{x:stage.stageWidth,delay:1});

karim beyrouti

unread,
Feb 6, 2015, 4:07:30 AM2/6/15
to bac...@gmail.com
This is because you are referencing the application stage before it has been added, in this case, to the host application's stage ( SWFRenderer ). 
Here is a Fix:

package
{
import flash.display.MovieClip;
import flash.events.Event;
import flash.utils.setTimeout;
public dynamic class MainTimeline extends MovieClip
{
public function MainTimeline()
{
super();
addEventListener(Event.ADDED_TO_STAGE , addedToStage ) ;
}
public function addedToStage( e : Event ) : void
{
setTimeout( startApp , 1 );// Added a timeout to give loaderInfo time to initialize
}
private function startApp() : void
{ trace( loaderInfo.width); // FIX: best option to use if you can;
trace( stage.stageWidth ); // could throw an error as you are accessing the application domain
}
}
}

Reply all
Reply to author
Forward
0 new messages