Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

Control timeline of a child created by loadMovie

My main timeline has a clip (myChildHolder) that will load an external .swf where I need to be able to stop/start it according to conditions of the parent.

The first/only frame of myChildholder is:
loadMovie("myChild.swf", this);
stop();

Because I'm loading into 'this' I expect the parent (_root) to be able to control the movie with:

myChildHolder.stop();

But it's not. It shouldn't make a difference that the .swf was created using Captivate, should it?
0
juststeve
Asked:
juststeve
  • 2
1 Solution
 
Aneesh ChopraCommented:
problem is every external resource takes time to gets loaded..
if you do the "loadMovie" and "stop" on same frame it will not take the "stop"..

You should do the "loadMovie" then check for the loading initailization and as first frame get loaded then do "stop"

here is the example:

put the following code on first frame it will do the all for you:
----------
myChildHolder.loadMovie("myChild.swf");
this.onEnterFrame = function()
{
      if (myChildHolder._framesloaded>1)
      {
            myChildHolder.stop();
            delete this.onEnterFrame;
      }
};
-----------



Rgds
Aneesh
0
 
Aneesh ChopraCommented:
To avoid the confusion...

you should paste the above mention code on the first frame of root.....
and remove the code on the first frame of "myChildholder"

I hope all would be clear...

Rgds
Aneesh
0
 
juststeveAuthor Commented:
Perfect....Thankx.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now