Preloader only works 25% of the time, loading external .swf

  • zizzo
  • Born
  • Born
  • zizzo
  • Posts: 1

Post 3+ Months Ago

Hay guys,

I'm using Flash MX 2004 and I've got a problem loading external .swf files.

When I click the button I've created to load the external .swf file, it plays in the empty movie clip as it should, but the preloader only functions about 25% of the time. The majority of the time the .swf plays, but the preloader indicates that 0% of the file has been loaded.

The button that I am using to load the external .swf file is located on a different frame than the empty movie clip that I am using to display the .swf. The button is called "LaserIcon_mc" and here are it's functions:

//LaserIcon_mc Functions
LaserIcon_mc.onRollOver = function()
{
LaserIcon_mc.play();
}

LaserIcon_mc.onRollOut = function()
{
LaserIcon_mc.gotoAndStop("f1");
}

LaserIcon_mc.onRelease = function()
{
gotoAndStop("ObjVids");
loadMovie("LaserBeam.swf",TvScreen_mc);
}

The button takes the user to the frame called "ObjVids" and the empty movie clip that the external .swf should be displayed in is called "TvScreen_mc" Here are the actions for the "ObjVids" frame:

//Siop Movie Clips
BackBtn_mc.stop();
TvScreen_mc.stop();

//BackBtn_mc Functions
BackBtn_mc.onRollOver = function()
{
BackBtn_mc.gotoAndStop("f2");
}

BackBtn_mc.onRollOut = function()
{
BackBtn_mc.gotoAndStop("f1");
}

BackBtn_mc.onPress = function()
{
BackBtn_mc.gotoAndStop("f3");
}

BackBtn_mc.onRelease = function()
{
TvScreen_mc.unloadMovie();
gotoAndStop("AObjects");
}

MyInterval = setInterval(preloader,10);
function preloader()
{
if(_root.TvScreen_mc.getBytesLoaded( >=_root.TvScreen_mc.getBytesTotal())
{
TvScreen_mc.play();
clearInterval(MyInterval);
}
LoadBar_mc._xscale = (_root.TvScreen_mc.getBytesLoaded()/_root.TvScreen_mc.getBytesTotal())*100;

LoadText_txt.text = Math.round(_root.TvScreen_mc.getBytesLoaded()/_root.TvScreen_mc.getBytesTotal()*100)+"% Loaded"
}

The button "BackBtn_mc" should also unload the .swf from "TvScreen_mc" so that when the user arrives back at the "AObjects" frame they can select another .swf to view through "TvScreen_mc" at the "ObjVids" frame.

I'm a pretty novas scripter. I've been looking for a solution for this problem for a while and I'm really out of Ideas at this point. I tried using "loadClip()" with loadListener, but it was complex and I couldn't find an example with the button and empty movie clip on separate frames. As a result, I wasn't sure what actions should go on which frames and I was unable to get the .swf to load at all that way.

please let me know if you guys have any solutions & thanks for being out there to help!

Zizzo
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 20 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.