Solved

how to target the original root from a loaded movie

Posted on 2006-11-13
3
190 Views
Last Modified: 2008-02-01
I've got a large project which I've had to disect into chunks.
I'm loading each swf in as a loaded movie with loadMovie("addprovider.swf", 1);
inside the addprovider.swf is a movie clip. At the end of this movie clips timeline I would like it to target the root of the holding original swf and get it to move on a frame to simultaneously unload the movie and load in the newt in the sequence.

ive tried
this._lockroot = true; on the first frame of the main swf with _root.gotoAndPlay(2); in the loaded movie but it isnt working,

the second frame of the main swf unloads the movie with
stop();
unloadMovie(1);
loadMovie("addclient.swf", 2);

I would be very grateful for any help!
0
Comment
Question by:sousflai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 17935353
if you use "this.lockroot=true" in any swf or in any movieClip, it means, that SWF or movieClip and all its child movieClips are refering it as "_root". "_root" has been locked for them, they can't go beyond that level.

1.
if you have not used "_lockroot=true" in child swfs, then you can simply access parent _root using "_root"

2.
but if you have used "_lockroot=true" in child swfs, then you can't acess parent "_root" directly..

wordaround in this scenario is, after child SWF loading you have to set a parent "_root" pointer inside child SWF.. for example:
------------
loadMovie("addclient.swf", 2);

//check for loading completion
this.onEnterFrame = function()
{
   if(_level2.getBytesTotal()==_level2.getBytesLoaded() && _level2._width>0){
     _level2.mainroot = this;
     delete this.onEnterFrame;
   }
}

----------------

now you can access parent "_root" inside child SWF using "_root.mainroot"

-Aneesh
0
 
LVL 5

Accepted Solution

by:
blockage1 earned 500 total points
ID: 17969550
Can't you simply target the original swf as  _level0? i.e.

_level0.gotoAndPlay(2);
0
 
LVL 12

Expert Comment

by:SamuelRostol
ID: 18179186
blockage1 is correct.

If you use _level0, you'll target the topmost level :)
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
adobe product that creates checks to sales people for bringing sales 5 396
IE 11 Flash Player issue 7 263
free photo watermark software 5 106
CD Rom not playing 13 91
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question