Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Help With Loadmovie And _lockroot



Hi! I'm a ne member. I'm having problems with an external movie I loaded into a movieclip using loadmovie. I have a movieclip called contentmv where I load external movies. Some of them are forms with input text objects.

The problem occours when I use masks. I included two test movies attached. Can you help me? The _lockroot is only working when the contentmv movie clip is NOT masked.



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 03-16-2007, 03:56 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

_lockroot With LoadMovie()
Does _lockroot not work with loadMovie()? I have a separate swf that I'm trying to load within a MC, but inside the swf are actionscript references to _root that are breaking in the main movie.

Are there ways to fix this? _lockroot doesn't seem to work. I'm having trouble trying to find the correct relative paths (this.parent.parent.....).

thanks

Tim

LoadMovie, _lockroot And Sound
Hello friends,

I have created a preloader that preloads a huge SWF. I am innocent as to it's size, a grand 7 MBs, all I want to do is this preloader. As there are several _root references in the SWF I placed a _lockroot in the first keyframe of the loaded SWF.

Amongst other things there is a sound_mc, containing a few AS Sound Objects, in my loaded SWF. By some strange reason the sound of the loaded SWF is not audible. I trace the sound object, it's there, I trace it's volume; it's at 60.

When I access the SWF directly I hear the sounds/music.

But still I cannot hear it. Anyone run into a problem like this?

LoadMovie, _lockroot And Sound
Hello friends,

I have created a preloader that preloads a huge SWF. I am innocent as to it's size, a grand 7 MBs, all I want to do is this preloader. As there are several _root references in the SWF I placed a _lockroot in the first keyframe of the loaded SWF.

Amongst other things there is a sound_mc, containing a few AS Sound Objects, in my loaded SWF. By some strange reason the sound of the loaded SWF is not audible. I trace the sound object, it's there, I trace it's volume; it's at 60.

When I access the SWF directly I hear the sounds/music.

But still I cannot hear it. Anyone run into a problem like this?

gracias

V.

_lockroot
Hello

I am curious as if anyone knows anything about the _lockroot script
I am working on this SWF project of coarse. It loads a External SWF into another. The main SWF is called Transmit. It loads a SWF titled Transimssion. In the Transmission SWF i have a news MC that is loaded as invisible when you click the News Button is sets it Visible. You click Close it sets it Invisible. Now everything works great, when i play Transmission without loading it into Transmit. I load it into Transmit, it doesn't set itself invisible when loaded, it does not Drag, clicking the News button doesn't make it visible, cna clicking close does not set it invisible. I have in Transmit. on the Empty MC that loads Transmission. The following code:


{
this._lockroot = true;
}
load_position.loadMovie ("transmission.swf");

This should make the code in Transimssion, when loaded into Transmit work but does not. Anyone have any ideas? Thanks alot.

WHAT? No _lockroot?
I am planning on converting my AS2 project over to AS3 as I learn, but I noticed a tip on senocular's website says that there is no _lockroot, which I use. What is the alternative?

_lockroot, Anyone?
Hello All,

I've got a rather large swf that I'm loading into a SCORM player. For some reason the whole huge library of bitmaps (screenshots for a demo and simulation) is publishing up front, and the whole assembly (2 mb as a swf) is taking 12 seconds to load in the SCORM player. All of my visual elements are movie clips in the library. The first is a loading bar and percent movie clip. Unfortunately, it only appears about a split second before the actual content screens. Which means 12 seconds of waiting with a blank screen, a blip of loading bar reading 100%, and then the content.

My solution, or what I would like to be my solution, is to create a swf which will load that large swf, and track loading progress.

This is the code in my loader movie:

Code:
stop();
the_stage = this;
//this._lockroot = true;
// LOAD MOVIE CLIP
the_stage.createEmptyMovieClip("mc_loader",this.getNextHighestDepth());
//mc_loader._lockroot = true;
var mc_listener:Object = new Object();
mc_listener.onLoadProgress = function(mc_loader,loadedBytes:Number, totalBytes:Number) {
trace('loading started');
var perc:Number = (loadedBytes/totalBytes);
txt.text = Math.floor(perc*100);
trace(txt.text)
};
mc_listener.onLoadComplete = function(){
trace('loading of movie is complete');
mc_loader._lockroot = true;
}
var my_mcloader:MovieClipLoader = new MovieClipLoader();
my_mcloader.addListener(mc_listener);
my_mcloader.loadClip("add_members.swf",mc_loader);
You can see where I've placed and commented out successive _lockroot settings. I'm not sure where lockroot should be placed and where it should not.

I am not currently setting _lockroot in the loaded movie clip. When I test the loader movie, trace statements tell me that it has successfully loaded. But none of the movie clips in the library are placed on the stage.

My trace for the fade in function for the first screen (a player skin around the content) looks like this:

Code:
fade_in function called for _level0.mc_loader.skin
The skin in "add_members.swf" never loads.

When I test add_members.swf on its own, the same trace reads as follows:

Code:
fade_in function called for _level0.skin
Now, I've read the Flash documentation for _lockroot, for loadClip, etc. but I'm still not clear on what is what once the new swf is loaded. Is mc_loader now what I add_members.swf? Are the two still separate? Where should I be setting _lockroot, and where not?

Many thanks for any assistance,
MB

Understanding _lockroot
I am having some difficulty getting my mind around the _lockroot script. I am loading an external .swf into a main .swf. I have a MC which contains a button that loads a .swf in the parent and works fine as a standalone, however when I call the .swf into the main.swf, the button no longer works.

Here is the code attached to the button within the child. I am trying to use _lockroot, but something is not correct.

Thanks.

on (release) {
loadMovie("1906video1.swf", _root.media);
this._lockroot=true;
}

Has Anyone Here Heard Of _lockroot?
Hi there,


Just wondering if anyone had heard of the code below :


Code:
this._lockroot = true;
I saw it on a tutorial site http://www.sephiroth.it/phpwiki/index.php/_lockroot and it is supposed to lock the _root for that file so say for instance you had a swf file called loader.swf load in another movie loadMe.swf into it then if you had used any _root assigned variables in the movie being loaded then they would still access the variables from that file and not think that the _root was from the file that loaded it!

I couldn't get this to work though. I tried a simple :


Code:
this._lockroot = true;
name = "My Name";
trace(_root.name);
in the file that is being loaded in but it just returned undfined! Does anyone know if this is supposed to work or whether it was an undocumented feature in Flash that is no longer supported or if there is another way of implementing this?

Any help would be greatly appreciated.

Regards,

Mark Bowen

_lockroot Problem
Hi all, is there a way of referencing a parent movie's timeline from a loaded clip if the loaded clip has _lockroot set to true? I know that is a bit of a strange one but I have a clip that needs lockroot to be true but I also need the same clip to receive a variable from asp once it has been loaded into another clip.

Is this possible?

Cheers,

jr.

_lockroot Question
I created a .fla which I copied and pasted into another Flash-project.
Now, is there a '_lockroot' - version for movie clips integrated in a "parent - .fla"; self-contained clips that are NOT loaded from an external source?

I know this sounds really unorthodox. It's just that I don't really feel like modifying all the script referring to '_root' in order to make it work fine in its new environment...
Thanks, aut.

_lockroot Not Working. Help, Please?
The project that I'm working on is a website that loads external SWFs. Here is the structure:

site.swf -> work.swf -> player.swf -> reel.swf (no .FLA available for reel.swf)

I am using _lockroot = true; on the main timeline of player.swf, but it doesn't seem to want to recognize _root as its own. player.swf has timeline controls for the reel.swf and a draggable progress playhead.

When loaded alone, player.swf functions perfectly. But when loaded from site.swf, none of the buttons work. Nor does the playhead.

Am I going about using the _lockroot command the wrong way? Any help would be appreciated -- and yes, I've looked and searched for solutions to using this command, but nothing seems to work so far.

Here is a link, if my description doesn't make sense. When it loads, click "work", then click the first button at the top left of that section "Director's Reel". www.ryanbrock.com/espinablanca

Problem With .flv And _lockroot
Hì gente, I have a problem with a movie.flv.

My .flv is in a .swf file loaded into another .swf file that is also loaded in another .swf where I had to set lockroot to true (because of some variables).

I know how to use the flv in a movie, but this time it works only when I test the swf, but when I play the entire site on the browser I see the swf but not the video and neather the player (a costumized skin) that are on it I think is because of the lockroot.. can anybody help me? Pleeease, I'm tring since days and I can't find a solution.

Thank's anyway for your attention

_root/_lockroot
Hey there
Need some help here. I'm doing a site where I've adapted an image gallery swf with a complicated AS and loading into the main swf at level 1. Is there a simple means of getting the main swf to refer to the external content the gallery is loading as being on the _root level? I thought i could use _lockroot but my understanding of it is pretty scanty and I'm unsure as to where I should place the code anyways

The site with the non-loading images is currently at
http://www.dalliancedesigns.com/vwcountry/cars.html
if anyone would care to take a look

Many thanks
tonto

_lockroot Not Working
Hi
am using the DateField component in my movie dateField.swf. I am loading this movie into an empty movieclip in my master.swf. When I run master .swf the DateField component (residing in the loaded in dateField.swf) doesn't work properly! The dateChooser automatically opens up, which is good but when the dateChooser closes after I chose a date I can't open it up again! When I run dateField.swf on its own everything works as it should. And I have the DateField component also in both libraries. I have used the following code in the master.fla but to no avail!

empty_mc.loadMovie("dateField.swf");//this works fine
empty_mc._lockroot = true;

can anyone help?

Using _lockroot In A Class
is it possible to use _lockroot in a Class, here is my code.

class DragAndDrop extends Button {
function DragAndDrop(locate) {
setUpDD(locate);
locate._lockroot = true;
}
function setUpDD() {
//////////////////////////////
// the trace does not work
//////////////////////////////
trace(_root.mc);
}
}

_lockroot And LocalToGlobal
I wrote a game that makes use of localToGlobal. Now the client wants to import this game into a presentation tool created in Flash. The games plays within a window in this presentation tool. However, the game fails because the localToGlobal translates the coordinates to the presentation tools root. I thought the _lockroot would solve this problem but it does not. Any ideas ?


Thanks.

_lockroot=true; ?
hello does thus work with as3? because trying 2 loadin a as3 movie into a as2 movie

_lockroot Alternative?
i have a flash game(swf) that i want to call on another swf (main stage) iwant to put it a blank mc. ive used _lockroot in flashmx2004 works just fine. but my client want it to be in flash mx .need help thanks!

_lockroot Not Working
I've created a swf with a scrollbar that loads into another swf. The problem is that the scrollbar does not work. I've used the _lockroot command on the the loader movie and on all of the assets with _root in the loading movie, but nothing works. All of the other functionality of the loading movie is there. I'm starting to feel like I'm spitting into the wind with this one even though I know it should work.

A Question About _lockroot
The parent movie "test.fla" is empty with follow actionscript code in timeline:

stop();
var tc = new TestClass(); //the wanted result is "_level0"
var myTest = _root.createEmptyMovieClip("myTestMovie", _root.getNextHighestDepth());
myTest.loadMovie("TestChild.swf");

===================================
The TestClass.as is :

class TestClass
{
function TestClass()
{
trace("Current root is : " + _root);
}
}

===================================
The TestChild.fla is empty with follow actionscript code in timeline:

stop();
this._lockroot = true;
var tc = new TestClass(); //the wanted result is "_level0.myTestMovie"

===================================================
But the result is :
_level0
_level0

===================================================
when I change the code in test.fla into the following:
stop();
//var tc = new TestClass();
var myTest = _root.createEmptyMovieClip("myTestMovie", _root.getNextHighestDepth());
myTest.loadMovie("TestChild.swf");

----------------------------
The result is correct :
_level0.myTestMovie

====================================================
Why? And how to do?
Help me!









Attach Code

//=============== in test.fla :==================

stop();
var tc = new TestClass(); //the wanted result is "_level0"
var myTest = _root.createEmptyMovieClip("myTestMovie", _root.getNextHighestDepth());
myTest.loadMovie("TestChild.swf");

//===================================
//=============== in TestClass.as : =================

class TestClass
{
function TestClass()
{
trace("Current root is : " + _root);
}
}
//====================================================
//================ in TestChild.fla: ===================

stop();
this._lockroot = true;
var tc = new TestClass(); //the wanted result is "_level0.myTestMovie"

























Edited: 06/22/2007 at 10:35:38 AM by utopiashi

_lockroot And Components
I'm developing couresware with flash that imports information from an XML file and displays it on a "frame". It will load in media files dynamically (swf, flv, jpg, etc...)

Some of the swf files we're importing have components in them and we use a _lockroot = true; to lock the root of the file.

Sometimes, on the first try, it works great, but then when you "refresh" the screen, it won't work. This just re-loads all the data on the screen.

When you go to the next slide, it breaks the functionality of the new swf file thats been loaded, but after refreshing THAT screen, it works fine.

Can anyone tell me whats wrong?

If you want to see what I'm talking about, click here: http://development.creativedynamix.net/FPMI/coursetest/CSO_LR0001_CBT/CSO_LR0001_CBT.html

_lockroot Not Working?
I can't get _lockroot to work.

I've tried it in a projector movie that is loading in another SWF (and it's this second one that I want to maintain the paths for). I've tried using it in an onClipEvent(load) in the projector attached to the target MC that the other SWF is loading into, I've tried adding it to the first frame of the other SWF (which is now located in a subdirectory but it wasn't originally, hence my need to maintain its status as "root" when it looks for other things to load in).

I just can't get it to work. Is there another way to do this???

_lockroot Not Working
Hi
am using the DateField component in my movie dateField.swf. I am loading this movie into an empty movieclip in my master.swf. When I run master .swf the DateField component (residing in the loaded in dateField.swf) doesn't work properly! The dateChooser automatically opens up, which is good but when the dateChooser closes after I chose a date I can't open it up again! When I run dateField.swf on its own everything works as it should. And I have the DateField component also in both libraries. I have used the following code in the master.fla but to no avail!

empty_mc.loadMovie("dateField.swf");//this works fine
empty_mc._lockroot = true;

can anyone help?

_lockroot Not Working?
I can't get _lockroot to work.

I've tried it in a projector movie that is loading in another SWF (and it's this second one that I want to maintain the paths for). I've tried using it in an onClipEvent(load) in the projector attached to the target MC that the other SWF is loading into, I've tried adding it to the first frame of the other SWF (which is now located in a subdirectory but it wasn't originally, hence my need to maintain its status as "root" when it looks for other things to load in).

I just can't get it to work. Is there another way to do this???

_root And _lockroot
Hi - hope someone can help me with this.

I have a movie (call it SUB) which is loaded into a main movie (call it MAIN).

In SUB is a button which I want, when clicked, to gotoAndPlay the timeline of SUB, AND also the timeline of MAIN.

In other words, if I use _root, I can change the frame of the main timeline of MAIN. No problem.

Now, how do I change the frame of the main timeline of the SUB at the same time?

I thought it may have something to do with _lockroot, but that just seems to make _root refer to the main timeline of SUB. I need to refer to both with one button click!

Hope this makes sense. Thanks!and

_lockroot Madness
Please HEEEELP, I'm going crazy over here...

Make loaded.swf from a new fla with a TextArea on the screen which has lots of text so it needs scrolling.

Add this code on the 1st frame.

[AS_lockroot=true;
_root=_level0.container;[/as]

And make a loader for the loaded.swf called loader.swf and then try scrolling the textArea, it drives me crazy...

I'm so mad I can't even explain it better

_lockroot Serious Problem
I have mc_loader.swf and mc_loaded.swf

mc_loader has an empty MovieClip called container on the 1st frame.
I have tried all possible ways of using _lockroot, both in mc_loader.swf and mc._loaded.swf, but I still have these problems:

textfield with var _root.user in mc_loaded.swf addresses the mc_loader.swf's _root.user no matter what, even if it's _root is _level0.container and it should address _level0.container.user .

I guess it's because it gets instantiated before any other code, since it's MM textfield...

Also, the TextFieldComponent I'm using starts selecting everythin on scroll, although if I run mc_loaded.swf it works normally.

In my desperate attempts to solve these I have put _lockroot in all the places I could think of in mc_loader.swf and the 1st script executed in mc_loaded.swf, but still no luck.

Is it just me or this _lockroot doesn't work 100% ?

Here's my code in mc_loader:

this.container._lockroot = true;
this.container.content._lockroot = true;
my_mcl = new MovieClipLoader();
myListener = new Object();
myListener.onLoadStart = function (target_mc){

}
myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes){
Kbytes=Math.round(target_mc.getBytesTotal()/1024);
procent=Math.round(loadedBytes/totalBytes*100);
_level0.loader.loaderText.text="Loading "+procent+"% ";//from "+Kbytes+"kb";
loader.gotoAndStop(procent);
}
myListener.onLoadComplete = function (target_mc){
loader._visible=false;
my_mcl.content._lockroot = true;
my_mcl.container.content._lockroot = true;
this.container._lockroot = true;
this.container.content._lockroot = true;
}
my_mcl.addListener(myListener);
my_mcl.content._lockroot = true;
this.container._lockroot = true;
this.container.content._lockroot = true;
my_mcl.container.content._lockroot = true;
my_mcl.loadClip("mc_loaded.swf","container");
my_mcl.content._lockroot = true;
my_mcl.container.content._lockroot = true;
this.container._lockroot = true;
this.container.content._lockroot = true;

Question About _lockroot
I am loading in a .SWF file that contains it's own functions. I locked the root of the loaded SWF so that saying _root. within itself refers to it's own _root and not the _root of the movie it is loaded into.

But the movie that loads the new SWF contains a function that I need to call from the new SWF.

These didn't work:

actionscript Code:






Original
- actionscript Code





_level0.functionName();
_parent.functionName();






 _level0.functionName();_parent.functionName();



Any ideas?

Thanks,

Preload Breaks _lockroot?
I have a game that gets loaded into an interface shell. On the first frame of my game I have this._lockroot = true.

So far in developmet this has been working perfectly. But now an issue has come up.

In the loader of the shell, an empty movieclip is created to preload the game (and the shell). When the game is finished loading, the movieclip created for the preload is destroyed (removeMovieClip) and the shell continues and does some other stuff and then the game is loaded later on into another preplaced movieclip.

Now the game's _lockroot doesn't work.

I have tried many things when destroying the preloaded clip (removeMovieClip, unloadMovie, delete, etc.) and still it doesn't work. Comment out the preloader for the game and everything works fine.

What's going on?

brad

_lockroot Popup Problem
Hi,

I’ve created a popup movie and I can’t lock the buttons in the movie clip below. The Scene contains: boxes_mc, about_mc, popup_mc.

The popup_mc covers both boxes_mc and about_mc, and the buttons inside those mc still active below the popup_mc.


about_mc contains the popup_mc calling button. The button code is:
on (release){ _root.boxes_mc._lockroot = true; }

I’m trying to lock the movies in the popup_mc too, with:
_root.boxes_mc._lockroot = true;

PS. I don’t understand the _lockroot mess. Is supposed lockroot to deactivate buttons?

_lockroot For External Paths
Hi,

I have a series of flash projects I'm loading into one main flash movie.

The projects are in separate folders and use relative URLs to load XML and images.

The problem is that when I load these flash files into the main flash movie, I get an "error loading URL" because it's trying to load the files from the main movie's location.

I'm wondering if there's a way to lock the path of a movie, like _lockroot does for Movieclips.

Thanks very much.

[F8] Drag N Drop With _lockroot
Hello!
We are developing a unit of work for kids. We have set a special stage environment to load all the different swfs and they are loaded into an empty movie clip using _lockroot.

The problem I am having is when I run the quiz swf in a stage environment. We have developed a stage component that encapsulates several SWF files and allows the viewer to navigate to any SWF file in the stage by simply clicking on the menu on the left.

The quiz works fine as a swf, but when I load it into the stage using _lockroot the drop won't work.

this is the code I have to load the quiz swf into my main swf:

Code:
loadMovie("Saesneg/8/helicopter.swf", "lockrootContent");
lockrootContent._lockroot = true;
stop();
and this is the code for my quiz:

Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
stop();
helicopter.stop();
city = ["Sydney", "Bangkok", "Amsterdam", "New York"];
map0._visible = 0;
map1._visible = 0;
map2._visible = 0;
map3._visible = 0;
wellDone._visible = 0;
unlucky._visible = 0;
wellDone.gotoAndStop(1);
unlucky.gotoAndStop(1);
unlucky.onPress = function() {
this.gotoAndStop(2);
_root.llun1Placed = false;
_root.llun2Placed = false;
_root["map"+cityVal].frame1._visible = 1;
_root["map"+cityVal].frame2._visible = 1;
tween1 = new Tween(_root["map"+cityVal].llun1, "_x", Regular.easeInOut, _root["map"+cityVal].llun1._x, -95, 1, true);
tween2 = new Tween(_root["map"+cityVal].llun1, "_y", Regular.easeInOut, _root["map"+cityVal].llun1._y, 355, 1, true);
tween1 = new Tween(_root["map"+cityVal].llun2, "_x", Regular.easeInOut, _root["map"+cityVal].llun2._x, 305, 1, true);
tween2 = new Tween(_root["map"+cityVal].llun2, "_y", Regular.easeInOut, _root["map"+cityVal].llun2._y, 355, 1, true);
_root["map"+cityVal].llun1.enabled = true;
_root["map"+cityVal].llun2.enabled = true;
};
unlucky.onRelease = function() {
this._visible = 0;
};
unlucky.onReleaseOutside = function() {
this.gotoAndStop(1);
};
unlucky.onRollOut = function() {
this.gotoAndStop(1);
};
wellDone.onPress = function() {
this.gotoAndStop(2);
};
wellDone.onRelease = function() {
this.gotoAndStop(1);
button0._visible = 1;
button1._visible = 1;
button2._visible = 1;
button3._visible = 1;
teitl._visible = 1;
tween1 = new Tween(hogyn, "_x", Regular.easeIn, hogyn._x, 656, 2, true);
tween2 = new Tween(hogan, "_x", Regular.easeIn, hogan._x, 40, 2, true);
tween3 = new Tween(_root["map"+cityVal], "_alpha", Regular.easeIn, 100, 0, 2, true);
tween4 = new Tween(button0, "_alpha", Regular.easeIn, 0, 100, 2, true);
tween4 = new Tween(button1, "_alpha", Regular.easeIn, 0, 100, 2, true);
tween4 = new Tween(button2, "_alpha", Regular.easeIn, 0, 100, 2, true);
tween4 = new Tween(button3, "_alpha", Regular.easeIn, 0, 100, 2, true);
tween5 = new Tween(teitl, "_alpha", Regular.easeIn, 0, 100, 2, true);
wellDone._visible = false;
_root.llun1Placed = false;
_root.llun2Placed = false;
};
wellDone.onReleaseOutside = function() {
this.gotoAndStop(1);
};
wellDone.onRollOut = function() {
this.gotoAndStop(1);
};
for (buttonCounter=0; buttonCounter<4; buttonCounter++) {
this["button"+buttonCounter].stop();
this["button"+buttonCounter].rhif = buttonCounter;
this["button"+buttonCounter].textVar = city[buttonCounter];
this["button"+buttonCounter].onPress = function() {
this.gotoAndStop(2);
};
this["button"+buttonCounter].onRelease = function() {
this.gotoAndStop(1);
cityVal = this.rhif;
button0._visible = 0;
button1._visible = 0;
button2._visible = 0;
button3._visible = 0;
teitl._visible = 0;
_root["map"+this.rhif]._visible = 1;
helicopter.play();
sortPicsOut();
tween1 = new Tween(hogyn, "_x", Regular.easeIn, hogyn._x, 800, 2, true);
tween2 = new Tween(hogan, "_x", Regular.easeIn, hogan._x, -160, 2, true);
tween3 = new Tween(_root["map"+this.rhif], "_alpha", Regular.easeIn, 0, 100, 2, true);
};
this["button"+buttonCounter].onReleaseOutside = function() {
this.gotoAndStop(1);
};
this["button"+buttonCounter].onRollOver = function() {
this.gotoAndStop(1);
};
}
function sortPicsOut() {
_root["map"+cityVal].llun1.onPress = function() {
this.startDrag();
};
_root["map"+cityVal].llun2.onPress = function() {
this.startDrag();
};
_root["map"+cityVal].llun1.onRelease = stopTheDrag1;
_root["map"+cityVal].llun2.onRelease = stopTheDrag2;
_root["map"+cityVal].llun1.onReleaseOutside = stopTheDrag1;
_root["map"+cityVal].llun2.onReleaseOutside = stopTheDrag2;
function stopTheDrag1() {
this.stopDrag();
if (this._droptarget == "/map"+cityVal+"/picDestination1") {
this._x = _root["map"+cityVal].picDestination1._x+5;
this._y = _root["map"+cityVal].picDestination1._y+5;
this.enabled = false;
_root.correct = true;
_root.llun1Placed = true;
_root["map"+cityVal].frame1._visible = 0;
} else if (this._droptarget == "/map"+cityVal+"/picDestination2") {
this._x = _root["map"+cityVal].picDestination2._x+5;
this._y = _root["map"+cityVal].picDestination2._y+5;
this.enabled = false;
_root.correct = false;
_root.llun1Placed = true;
_root["map"+cityVal].frame1._visible = 0;
} else {
tween1 = new Tween(_root["map"+cityVal].llun1, "_x", Regular.easeInOut, this._x, -95, 1, true);
tween2 = new Tween(_root["map"+cityVal].llun1, "_y", Regular.easeInOut, this._y, 355, 1, true);
}
if ((_root.llun1Placed) and (_root.llun2Placed)) {
finished();
}
}
function stopTheDrag2() {
this.stopDrag();
if (this._droptarget == "/map"+cityVal+"/picDestination1") {
this._x = _root["map"+cityVal].picDestination1._x+5;
this._y = _root["map"+cityVal].picDestination1._y+5;
this.enabled = false;
_root.correct = false;
_root.llun2Placed = true;
_root["map"+cityVal].frame2._visible = 0;
} else if (this._droptarget == "/map"+cityVal+"/picDestination2") {
this._x = _root["map"+cityVal].picDestination2._x+5;
this._y = _root["map"+cityVal].picDestination2._y+5;
this.enabled = false;
_root.correct = true;
_root.llun2Placed = true;
_root["map"+cityVal].frame2._visible = 0;
} else {
tween1 = new Tween(_root["map"+cityVal].llun2, "_x", Regular.easeInOut, this._x, 305, 1, true);
tween2 = new Tween(_root["map"+cityVal].llun2, "_y", Regular.easeInOut, this._y, 355, 1, true);
}
if ((_root.llun1Placed) and (_root.llun2Placed)) {
finished();
}
}
}
function finished() {
if (_root.correct) {
wellDone._visible = 1;
} else {
unlucky._visible = 1;
}
}
Any ideas would be gratefully appreciated!
Many thanks

[F8] This._lockroot=true; WON't Work
Hi,

I'm trying to lock the root of an mp3Player.swf that I load into a mc. The Mp3Player works good when its byItself, but when I add it to my Movie the button won't work.


N E suggestions?

Issue With 'this._lockroot = True;'
Hi there,

I've created a swf file that has various movie clips within it, and some navigation functionality from within the movie clips. To ensure the navigation works correctly, I've referred everything back to _root and taken it from there. For example

mc_slider_btn.onRelease = function(){
stopDrag();
if (eval(this._droptarget) == _root.mc_screen.mc_slider.green_box)
_root.mc_screen.gotoAndStop("on_screen");
}

this works fine, however... I'm ultimately looking to load this into a movie clip in a second flash file. Anticipating this, I used to following code in the first keyframe of the _root in the first flash file:

this._lockroot = true;

Hoping this would lock the root and all navigation commands within the file would still work when loaded into the second flash file via a movie clip.

They dont The file loads fine, but the navigations features no longer work. Its as if the this._lockroot = true; command is non-existent.

Can anyone offer any help?

Many thanks.

For ref: I'm using the following code in the second flash file to load in the swf:

loadMovie("filename.swf", mc_name);

Why Is _lockroot Mucking Up My Movieclip
I have made a movieclip for the purpose of inserting into other flash files which I am authoring - I'll call it a 'component' but it's not actually a component in the strict flash sense of course, it's a movieclip. It requires a _lockroot to function properly inside other files.

Everything works fine except for some rollover animations within the 'component' which have stopped responding. They use this code:


Quote:




onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}




They do nothing now the _lockroot is applied.

I tried applying instance names as opposed to 'this' but this, conversely, causes the animations to play with wild abandon.

Any help to solve this appreciated!

Drag N Drop With _lockroot
Hello!
We are developing a unit of work for kids. We have set a special stage environment to load all the different swfs and they are loaded into an empty movie clip using _lockroot.

The problem I am having is when I run the quiz swf in a stage environment. We have developed a stage component that encapsulates several SWF files and allows the viewer to navigate to any SWF file in the stage by simply clicking on the menu on the left.

The quiz works fine as a swf, but when I load it into the stage using _lockroot the drop won't work.

I thought that the drop target might be wrong, but now I'm starting to think that it might be something to do with the _lockroot. Any ideas?
Many thanks

This._lockroot = True; Issue
i'm having a problem keeping the speed (frames per second)of the swf file once loaded into the main movie (container). I am able to load the movie, but i can't keep the speed of the swf file. i tried using this._lockroot = true; both in the swf and in the container of the main movie. does anyone know how i can keep the speed of the swf movie because otherwise i'm gonna have to code the img effect and that would be difficult. the swf file once loaded sets itself to the main movie speed.please help me!!

This._lockroot = True; Issue
i'm having a problem keeping the speed (frames per second)of the swf file once loaded into the main movie (container). I am able to load the movie, but i can't keep the speed of the swf file. i tried using this._lockroot = true; both in the swf and in the container of the main movie. does anyone know how i can keep the speed of the swf movie because otherwise i'm gonna have to code the img effect and that would be difficult. the swf file once loaded sets itself to the main movie speed.please help me!!

Unloading A _lockroot Movie
I've got this vexing problem. I want to load a short quiz created from the flash quiz template into a movie. The problem is that navigation in the quiz template needs _lockroot enabled in order to be able to function correctly. The question is, after I am done, how do I unload it.

I'm loading using this code:


Code:

var mList:Object = new Object();
var mLoad:MovieClipLoader = new MovieClipLoader();
mLoad.addListener(mList);
var hold:MovieClip = this.createEmptyMovieClip("holder", this.getNextHighestDepth());
hold._x = 0;
hold._y =0;
loadQCBtn.onRelease = function(){
mLoad.loadClip('QualityControl.swf',holder);
this.enabled = false;
}
The unload code I am using for a different movie that is not bound by _lockroot , to get back to the navigation page is


Code:

myButton.onRelease = function(){
unload()
}
I'm not that proficient of a coder to know what to change in the quiz navigation actionscript to make the code work.

Any help would be greatly appreciated!

Loader, _lockroot, & Totalframes
Hello to all! I'm new as a member to this forum, but I've been here for a while lurking and searching, over and over, trying to get back into Flash after a LONG sabbatical.

So please forgive in advance that I'm probably missing something pretty basic here.

I have three (at least in my mind) related questions:

I'm trying to use one FLA movie to load and play a number of external SWFs (generated with Captivate), but suffice it to say that I've only got access to the SWFs (not the FLAs).

Here's the problem(#1): I'm trying to use the Loader component for each of these SWFs, but as soon as I add more than one Loader/SWF to the FLA, it breaks.

I'm putting the button with script in 1st frame a of a scene, then telling it:

[as]
on (release) {
//Movieclip GotoAndStop Behavior
_root.gotoAndStop("sales_machine_swf01");
//End Behavior
};
[/as]

The marker "sales_machine_swf01" is in the same frame that contains the Loader component, which actually does play properly to the end of the loaded SWF (as long as that's the ONLY loader in the FLA).

Which makes me think it has something to do with _lockroot, which in the Flash documentation says you should add the following code:

[as]
myMovieClick._lockroot = true;
[/as]

Okay, I'll be happy to do that, but HOW do you add code TO a component?!? I click on the Loader component, click on the script, and add it there, but I don't see the rest of the script that comprises the component (in old Director days, you used to be able to access a widget through the GUI or through code; isn't Flash roughly similar?) Or is that not possible in Flash?

I gather there are generally two ways to make use of components in Flash (GUI and script), but I have no clue how to properly configure and use the Loader component without including a bunch of code for stuff I don't need. ALL of the tutorials I've seen talk about listener objects based on progress of the loader, etc. But I am loading ALL of these SWFs from a local disk, and don't really have to worry about progress of the loader actually LOADING; I just need to know about progress as the movieClip plays back.

Which brings me to my next point(#2): Although the loaded SWF plays just fine, when it comes to a stop, I can't get it to return to where I was at (previous menu), without attaching a script to the loader:

[as]
on (release) {
//Movieclip GotoAndStop Behavior
_root.gotoAndStop("sales_machine_1");
//End Behavior
};
[/as]

And then this makes it so that at ANY time while the SWF is playing, if I click anywhere on the screen (since the SWF covers the entire screen) it interrupts the SWF and returns me to the first frame of the scene (previous menu), but this conflicts with the Captivate controls which allow the user to scrub, pause, play, forward, rewind, etc.

Next problem(#3): Of course, this scipt wouldn't even be necessary if, instead of requiring any action on the part of the user, I could simply detect when the movieClip was done playing and automatically trigger the script that returns to the previous menu.

I saw a code example using _totalframes and _currentframe, and I figured I'd do something like this:

[as]
onClipEvent (enterFrame) {
if (swf01_movieClip._currentframe>=swf01_movieClip._t otalframes) {
_root.gotoAndStop("sales_machine_1");
}
};
[/as]

But that never ends up triggering the gotoAndStop. I tried tracing the result of the IF statement, but it ALWAYS results in TRUE (without actually triggering the result I want.

If there's another (preferrably simpler) approach I should be taking instead of this, I'd be completely open to it.

Thanks in advance to anyone who can point me in the right direction on any or all of these quandries!

Does This._lockroot Work With _root.createEmptyMovieClip
hello and thank you again.
does this._lockroot work with _root.createEmptyMovieClip.
i am loading a movie into my main movie and this._lockroot is not working. i am using mx 2004 and have tried using for the file being loaded:
this._lockroot = true;
and when that didn't work tried using in the main movie:
onClipEvent (load)
{
this._lockroot = true;
}
music_mc.loadMovie ("playerxml.swf");

also, since playerxml.swf creates an empty mc (sound_mc) i tried:
onClipEvent (load)
{
this._lockroot = true;
}
music_mc.sound_mc.loadMovie ("playerxml.swf");
any thoughts are greatly appreciated...

MovieClipLoader & _lockroot Makes Me Angry
I've come across a rather strange problem with the MovieClipLoader - I have an actionscript file, which simply creates an empty movie clip on the root and loads a movie into it. The root of the movie clip is locked before the swf is loaded.

class loader {
public function loader(n:Number) {
var loader_clip = _root.createEmptyMovieClip("test_" + n, n);
loader_clip._lockroot = true;
var loaderListener = new Object();
var loadertest = new MovieClipLoader();
loadertest.loadClip("Circle.swf", loader_clip);
}
}

All i have for code in my .fla is this :
var one = new loader(1);
var two = new loader(2);

and all I have for code in my loaded Circle.swf is
trace(_root);

Unfortunately, for some reason MovieClipLoader assigns the same root to both clips! For example, when I run my .fla, i get this as a trace:

_level0.test_2
_level0.test_2

when i SHOULD get

_level0.test_1
_level0.test_2

I have absolutely no idea why moviecliploader would act this way...i need to load the same movie multiple times and it has dynamic content, so I need _lockroot to work...any ideas?

Quiz Template _lockroot Trouble
When loading an external quiz swf (created with the MX quiz template and using the loader component or loadMovieNum), the results page doesn't work. I used
ActionScript Code:
this._lockroot = true;
in the external quiz. Any other ideas?

Small Problem With This._lockroot = True
ok, i'm setting up my transitions, and everything works fine except for one movie. on my main nav, I have about, portfolio, links and misc. Now, all the sections will transition perfectly except for the portfolio section.

I'll click the button and the portfolio.swf will transition in. on the midframe, i have another movie clip holder (named portcontainer) that loads external portfolio pieces in with the click of a button. Everything works fine, UNTIL i want to leave the portfolio section. On the first frame of my portfolio movie I have the code


Code:
midframe = 90;
this._lockroot = true
_level0.midframe = false
on the midframe I have


Code:
stop();
_level0.midframe = true
on the button code on my nav is...


Code:
stop();
this.onEnterFrame = function() {
if (rewind == true) {
prevFrame();
}
};
this.onRollOver = function() {
rewind = false;
play();
};
this.onRollOut = function() {
rewind = true;
};
this.onReleaseOutside = function() {
rewind = true;
};
this.onRelease = function() {
trace(_root.currMovie)
if (_parent.currMovie != "portfolio" && _level0.midframe == true) {
_parent.currMovie = "portfolio";
_parent.container.play();
}
};
The only movie that wont play from the midframe is the portfolio movie.... i'm pretty stuck, any help?

MovieClipLoader & _lockroot Makes Me Angry
I've come across a rather strange problem with the MovieClipLoader - I have an actionscript file, which simply creates an empty movie clip on the root and loads a movie into it. The root of the movie clip is locked before the swf is loaded.

class loader {
public function loader(n:Number) {
var loader_clip = _root.createEmptyMovieClip("test_" + n, n);
loader_clip._lockroot = true;
var loaderListener = new Object();
var loadertest = new MovieClipLoader();
loadertest.loadClip("Circle.swf", loader_clip);
}
}

All i have for code in my .fla is this :
var one = new loader(1);
var two = new loader(2);

and all I have for code in my loaded Circle.swf is
trace(_root);

Unfortunately, for some reason MovieClipLoader assigns the same root to both clips! For example, when I run my .fla, i get this as a trace:

_level0.test_2
_level0.test_2

when i SHOULD get

_level0.test_1
_level0.test_2

I have absolutely no idea why moviecliploader would act this way...i need to load the same movie multiple times and it has dynamic content, so I need _lockroot to work...any ideas?

Question About The Famous This._lockroot=true;
Hi everybody
I try to load a swf through a Loadmovie function. the swf loads but without animation. After research, I found out that to get the animation I have to put the following
this._lockroot=true; in the first frame of the main stage. But on this frame I already have

stop();
_root.captions._visible = 0;
When I add the this._lockroot=true, nothing happen, my swf is still without animation.
I am not an expert... can sbdy help?
Thanks

Small Problem With This._lockroot = True
ok, i'm setting up my transitions, and everything works fine except for one movie. on my main nav, I have about, portfolio, links and misc. Now, all the sections will transition perfectly except for the portfolio section.

I'll click the button and the portfolio.swf will transition in. on the midframe, i have another movie clip holder (named portcontainer) that loads external portfolio pieces in with the click of a button. Everything works fine, UNTIL i want to leave the portfolio section. On the first frame of my portfolio movie I have the code


Code:
midframe = 90;
this._lockroot = true
_level0.midframe = false
on the midframe I have


Code:
stop();
_level0.midframe = true
on the button code on my nav is...


Code:
stop();
this.onEnterFrame = function() {
if (rewind == true) {
prevFrame();
}
};
this.onRollOver = function() {
rewind = false;
play();
};
this.onRollOut = function() {
rewind = true;
};
this.onReleaseOutside = function() {
rewind = true;
};
this.onRelease = function() {
trace(_root.currMovie)
if (_parent.currMovie != "portfolio" && _level0.midframe == true) {
_parent.currMovie = "portfolio";
_parent.container.play();
}
};
The only movie that wont play from the midframe is the portfolio movie.... i'm pretty stuck, any help?

Losing Sounds W/ External Flash & _lockroot?
Any idea why I lose my sounds when I load an external flash movie and _lockroot it?

it plays fine, just all the Sound.attacksounds() are not playing. Is this a problem with the linking? Any workaround?

Copyright © 2005-08 www.BigResource.com, All rights reserved