all groups > flash actionscript > june 2006 >
You're in the

flash actionscript

group:

level issues


Re: level issues -->dan mode
6/30/2006 3:22:10 PM
flash actionscript:
Why not change the script of the swfs being loaded into the main swf?

--

Dan Mode
*THE online Radio* http://www.tornadostream.com
*Must Read* http://www.smithmediafusion.com/blog
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11

[quoted text, click to view]

level issues BeniRose
6/30/2006 9:13:59 PM
Hey guys. I'm currently working on a project where all the content movies are
seperate SWF files (because they handle the content differently on each "page")
and I'm loading them into my main movie depending on which link they click.
Right now I'm having problems getting my included (content) movies working
properly in my main movie. They work perfectly when I publish them as their own
SWFs, but as soon as I load them in my main movie they don't work. This is
because the levels (depths) are different when they're loaded into my main
movie (_root is no longer the _root of the included SWF, but now the _root of
the main movie). So I thought maybe I should load my container movieclip into
level5 and then in my included SWF call _level5 anywhere I used to call _root.
However I'm having problems with this. Here's my code for including the SWF
content movies:

var container:MovieClip = createEmptyMovieClip("container", 5);
container._x = 515;
container._y = 121;
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("News.swf", container);

However, If I trace(container._level) it says _level0, even tho I put 5 in the
depth parameter. Am I doing something wrong. Is there anyway to load an SWF
into it's own environment so "_root" in any actionscript in the included
content movie is the root of the content movie and not of my main movie? Any
and all help is appreciated and thanks a lot guys!

~Ben~
Re: level issues BeniRose
6/30/2006 9:39:41 PM
Well I tried changing anywhere it said like _root.whatever to
_root.container.whatever (this shoudl work considering the movie i'm loading
news.swf into is an empty clip called container) but it sitll wasn't working.
So I was wondering if there was more straight forward way, like putting it all
on it's own level, but i cant' figure it out. Thanks for the quick reply though!

~Ben~
Re: level issues BeniRose
6/30/2006 9:49:13 PM
Ok, I got it working...I saw that in my onLoadInit it displayed that my new
movie clip was _level0.container so I just went back to my news.swf movie and
changed any reference to any movie object to have a _level0.container. before
it. I guess I'll just have to keep this in mind while I'm building the other
movies. If this is a bad way to do it or if there's a better way to do
it...please let me know, but thanks guys!
AddThis Social Bookmark Button