PDA

View Full Version : Loading External swf


the_nth_man
10-07-2004, 05:19 AM
I've got some huge external swf (2 Meg +) that I need to load. Right now I'm spawning a new window with a preloader that uses loadMovieNum() to load them into a _level but the preloaders won't even work over the web.

Any suggestions or any threads that could help? Thanks.

mfrank410
10-07-2004, 08:32 AM
This solution will only work if the external swf file is interactive or not.

You could stream the external MC into your main swf. Here's some sample code to try out"

// make a connection
var hookup_nc:NetConnection = new NetConnection( );
hookup_nc.connect( null );
// Create a NetStream instance
var showTime_ns:NetStream = new NetStream( hookup_nc );
//Attach the NetStream to the video on stage
dict_video.attachVideo( showTime_ns );
// Set buffer to 2 seconds ( or whatever you want )
showTime_ns.setBufferTime( 2 );
// Play Video
play_btn.onPress = function( ) {
showTime_ns.play( "dict.flv" );
};

// Rewind
rewind_btn.onPress = function( ){
showTime_ns.seek( 0 );
};

// Stop video
stop_btn.onPress = function( ){
showTime_ns.close( );
};

// Pause Video (toggle )
pause_btn.onPress = function( ){
showTime_ns.pause( );
};


You will need to convert your external swf file to a flv. To do this you need to export the swf file as an avi, then add the avi to your project library, right click and convert to flv.

Hope this helps.