Despite some great help, I'm having some fun controlling my AS2 Movieclips from an AS3 project.

The basic scenario (as before) is that I have

AS3Project, AS2ProxySWF, AS2SWF

The AS3Project loads the AS2ProxySWF.

The AS2ProxySWF messages the AS3 Project to say that it's running.

The AS3Project uses a local connection to tell the AS2 Proxy to load a particular AS2 SWF.

The AS2 Proxy loads the AS2 SWF using a MovieClipLoader(MCL).

If I test the AS2 Proxy standalone (hardcoded load of the required AS2 SWF), the MCL handles the onCreationComplete event and runs the handler, so I know when the AS2 SWF has loaded.

When the proxy is loaded into the AS3 project, the MCL doesn't run the onCreationComplete handler, so I can't easily tell if the AS2 SWF has loaded.

With my existing code the AS2 Proxy has an onEnterFrame handler that attempts to detect when the MCL has fully loaded the AS2 SWF.

When I run the AS3 project form the flash IDE, my detection always works and once the AS2 SWF has loaded I stop it from running. Perfect.

When I run the AS3 swf via a browser, the AS2 SWF loads but doesn't stop.

This is how I'm trying to detect when the AS2 SWF has loaded:

this.onEnterFrame = function()
{
 if (this["xx"]._totalframes > 1) {
  this["xx"]._lockroot = true;
  if (this["xx"].getBytesLoaded() < this["xx"].getBytesTotal()) {

etc.

Can anyone suggest a reliable way to know when the proxy has loaded the SWF so I can take command of it's timeline?

I realise that timings can and will change between the browser and the IDE, but can't quite spot why this is a problem here.

If anyone has some reliable code..

Paul

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to