Solved

how to target the original root from a loaded movie

Posted on 2006-11-13
3
191 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
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.

624 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