_level?
basic question, how does a mc read what level it's on?
thnx
Ultrashock Forums > Flash > Flash Professional
Posted on: 2004-02-17
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How Can I Put A _level Forward? Or How Can I SwapDepths Of A _level?
siplyfied situation:
I have a preloader, that loads home.swf into _level5 and me.swf into _level6. I start at the HOME-Page. That works. I also have a NavigationMenu-------- When I press the button "me", this happens:
on(release){
unloadMovieNum (5);
_level6.play();
}
the same for the button "home":
on(release){
unloadMovieNum (6);
_level5.play();
}
each _level covers the whole stage.
I read somewhere that when I unload a Movie it still is in the cache of the browser, right?
here the problem:
when I jump to the "me"-page and go back to the "home"-page. I only see blank, instead of "home". I think that is because eventhough _level6 is unloaded it still covers the screen because _level6 generally covers _level5.
can i swapDepths of a _level?
Any Ideas?
_level To MC
One BIG problem, so listen up and PLEASE try to help me.
Is there a way to convert movie that is loaded on _level,
with loadMovieNum, to Movie Clip,
In script i can`t use loadMovie function for some reasons, it needs to be loadMovieNum.
tnx.
_level
How do I make to choose the _level of a MovieClip when I add it from the library to a layer?
Is that possible or I need to use loadMovieNum("myExternalMovie.swf", 1);? If I have to use the loadMovieNum how can I choose where I want my movie clip to be on the page?
_level
How do i go to a previous level.... if i'm in
Main > Movie clip > Other clip > "button"
how can i make the button do actions in "movie clip", i need to go back a level..... how can i do it?
_level
Hi,
Can anybody tell me the difference between _level, _root, _parent
I always get messed up when I use them.
chikku
_level HELP
Hey guys,
I'm went through this tutorial that showed how to attach music to a movie, but it didn't say what needed to be changed to allow it to load in a different level. Could someone tell me where to add _level15 to this actionscript?
[HTML]// initiate sound
music = new Sound();
music.attachSound("backsound");
music.start(0, 999999);
// set the volume of the sound to zero
music.setVolume(0);
// set a variable named 'vol'
vol = 0;
// set another variable named 'fade', putting a setInterval function in it
fade = setInterval(fadeIn, 100);
// set the initial fade in function
function fadeIn() {
// fade the sound in with an increment of 10 in the variable 'vol'
vol += 10;
music.setVolume(vol);
// put an if condition to restrict the increment in volume after it reaches to 100
if (vol>=100) {
clearInterval(fade);
// create the 'step' variable
step = 8;
// create the 'fade' variable
Fade = 0;
}
}
// create the fade in and out function
// function executed on onEnterFrame
_root.onEnterFrame = function() {
// set fade out
if (Fade == 1) {
vol = vol-step;
if (vol<0) {
vol = 0;
}
music.setVolume(vol);
// set fade in
} else {
vol = vol+step;
if (vol>100) {
vol = 100;
}
music.setVolume(vol);[/HTML]
_level - How To
Hey, im currently building my first site in flash, and can use a little help. I have a number of seperate swf files which i want to load onto the main page by clicking on vbariouw buttons. I have been told to use levels, unfortuantely no one has actually explained this to me. Is this anybody out there capable of this feat. Any replys, examples, links or coding would be so much help.
Thankyou
[F8] Get _level?
I want to load swfs on alternating levels. Is there a way to discover the next highest level?
_level HELP
Hey guys,
I'm went through this tutorial that showed how to attach music to a movie, but it didn't say what needed to be changed to allow it to load in a different level. Could someone tell me where to add _level15 to this actionscript?
ActionScript Code:
// initiate sound
music = new Sound();
music.attachSound("backsound");
music.start(0, 999999);
// set the volume of the sound to zero
music.setVolume(0);
// set a variable named 'vol'
vol = 0;
// set another variable named 'fade', putting a setInterval function in it
fade = setInterval(fadeIn, 100);
// set the initial fade in function
function fadeIn() {
// fade the sound in with an increment of 10 in the variable 'vol'
vol += 10;
music.setVolume(vol);
// put an if condition to restrict the increment in volume after it reaches to 100
if (vol>=100) {
clearInterval(fade);
// create the 'step' variable
step = 8;
// create the 'fade' variable
Fade = 0;
}
}
// create the fade in and out function
// function executed on onEnterFrame
_root.onEnterFrame = function() {
// set fade out
if (Fade == 1) {
vol = vol-step;
if (vol<0) {
vol = 0;
}
music.setVolume(vol);
// set fade in
} else {
vol = vol+step;
if (vol>100) {
vol = 100;
}
music.setVolume(vol);
}
};
_level?
is _root same as _level0?
or is _level1 the timeline inside a movieclip on the _root?
Using _level
hi ..as the title suggest, I've made a simple flash just to learn how to control another swf file from root using _level actionscripts, it's containing 2 file, one is the main.swf and the other (named bur1.swf) is loaded on the main using loadmovienum action. on the main swf, I made a three button that could control bur1.swf timeline (using _level actionscripts) but the problem is, I could not make it work at all.. I would like if some one could see if I had done anything wrong.
any help is really appreciated..
thank you in advance..
Using _level
Hi,
Now while my introduction is playing, other external swf files will be loading in the background using "loadMovieNum" to load them into different levels.
As i have included a preloader in every single swf file, i am not able to put a "stop()" in the 1st frame of my externals swf files.
Therefore, it would start to play upon loading is done.
But i would like the external swf files to be played only when needed.
Therefore, i have tried doing this.
loadMovieNum("movie1.swf,100);
_level100._visible = false.
But it is not working, as movie1.swf will still be played after it has loaded.
Is this the correct way to do? Or is there any better solutions?
Really appreciate for replies as this is urgent!
Thanks alot!
Set _level
I want to set the actionscript in red to be on the top level. Everytime I run this the loaded.swf is always behind the BrowserBackground. How would I flip flop this in AS3?
import com.gfxcomplex.display.*;
var _test = new BrowserBackground(stage, "http://jennifersfinefoods.com/dev/background.jpg");
var request:URLRequest = new URLRequest("loaded.swf");
var loader:Loader = new Loader();
loader.load(request);
addChild(loader);
_level?
is _root same as _level0?
or is _level1 the timeline inside a movieclip on the _root?
Using _level
hi ..as the title suggest, I've made a simple flash just to learn how to control another swf file from root using _level actionscripts, it's containing 2 file, one is the main.swf and the other (named bur1.swf) is loaded on the main using loadmovienum action. on the main swf, I made a three button that could control bur1.swf timeline (using _level actionscripts) but the problem is, I could not make it work at all.. I would like if some one could see if I had done anything wrong.
any help is really appreciated..
thank you in advance..
_level
I am trying to make the window to always come to teh top level and here is my code. (it isn't working...captain obvious)
Code:
windows.securityWin.onRelease = function()
{
this._parent._level = 99;
}
windows.houseWin.onRelease = function()
{
this._parent._level = 99;
}
_level Control
does anyone know how to control mc's in other levels?
for example tell _level2, mc1 play frame 5 in there...
using flash 4 to publish though..
appreciated if any help given asap!!..
Cheers,
dAl
How _level Works?
HI!
I'm trying send a variable to another level. I tryed use _level but doesn't works. I tryed use _level to control another level but doesn'works. What can I do? Somebody knows can explain me how _level works. This is a example how I write the script:
_level1.gotoAndStop("scene 3", 1);
"_level" was not blue, why???
In this moment, these are the questions of my life!
_level Of Trouble
I'm loading a number of movie clips in to _level40 the problem is I can't change the level on which they appear. When I load the movies in I keep them in the library and then attach them however they don't seem to go on to the levels I want and they always go to the top (front/highest level).
I've tried not attaching them and having them sitting on the main timeline of the loaded clip but they still stay on the top. Even though they should be loading into _level40, if I create and instance of a clip on _level2000 it appears behind the loaded clip?
I hope that makes sense to sombody!
_level Problem
I have a movie been loaded into my main movie on level10 now I have a movie clip in the main movie that checks to see if the mouse is gone past its paremeters which is the size of the main movie . If it is gone past its paremeters then I want the loaded movie to stop.
Code:
// main movie checker mc
onClipEvent (enterFrame) {
if (_root._xmouse>_root.right || _root._xmouse<_root.left || _root._ymouse>_root.bottom || _root._ymouse<_root.top) {
_level0.testplay=false;
} else {
_level0.testplay=true;
}
}
//==================================
external swf
if (_level0.testplay) {
gotoAndStop(2);
} else {
gotoAndStop(1);
}
_level Command
Hi there, after searching through all the help files I can find, I found numerous refrences to the _level command, however, how do I set this?
Must the movies I set with _level be external movies? or can they be a movie clip within a scene? I am sorry if this is just a simple command somewhere to set the level number, but I simply cannot find it.
any help would be appreciated
thank you
I Give Up - Please Help With _level
I've been working on this for a couple of hours now and it is escaping me. _level0 seems to work find when a movie is played by itself but _level0,_level1 etc doesn't seem to have any effect when played within a loaded movie. I've been avoiding it too long. Could someone be kind enough to explain this _level stuff and what I'm doing wrong?
Thanks
_level Help QUICK PLEASE
Ok, Prob!!
SETUP:
I have a movie "A BLACK BOX" on the stage called "ADD".
This movie contains 2 frames. Frame 1 is Black and Frame 2 is red.
When you click on the black box it turns red. and when you click on the red box it turns black.. Im sure that you get that but..
Ok the Prob is:
The movie is on Level 0, and I want the movie to move to level 10 when you click on the black box, and back to level 0 when you click the red box...
Please help, As I am CONFUSSED!!!!!! ARRRRRR
Thanks
GetProperty For _level..
Ok simple
this do not work,
getProperty (_root._level2, _x);
and this do not work
getProperty (_level2, _x);
and this do not work
getProperty (_parent._level2, _x);
from a "first child" MC,
anyone know what to do?
GetProperty(this._level)
Is there any way to find out which level a movieClip has been created on? I need to be able to have the level increment itself as more movie clips are dynamically created.... and I've tried this._level, this.getDepth and this._depth. Ideas?
_level And Variables
is it possible to use variables with _level as in _leveln.
~~~~~~~~~~~~~~~
attach = function (number) {
loadMovieNum (myMovies[number-1]+".swf",number) ;
var mc = _levelnumber ;
mc._x = 200 ;
mc._y = 200 ;
mc._alpha = 0 ;
mc.onEnterFrame = fadeIn(number) ;
}
~~~~~~~~~~~~~~
This function isn't parsing the variable within _level. I'm assuming my syntax is wrong.
Regards
Masking A _level?
Is it possible to "mask" a _level in Flash MX? The reason I'm asking is because when I load my swf to an MC holder, the movie LAGGGGGGGGSSSSSSSSSS big time, but if I load it to a _level, it works just fine. So, is it possible to "mask" a _level?
_level Loader
I have this loader set up but it won't recognize the level in order to get the bytesloaded and bytesTotal. I am sending the level as a parameter to the function
Code:
//====== Inital Level Loader ===============
levelLoader = function (file, level) {
lev = "_level"+level;
loader_holder._x = 600.0;
loadMovieNum(file, level);
trace("LEV :"+lev);
progressCheck.onEnterFrame = function() {
var percent = (lev.getBytesLoaded()/lev.getBytesTotal())*100;
if (!isNan(percent)) {
_root.loader_holder.bar._xscale = percent;
} else {
trace("0% loaded");
}
if (percent == 100 && lev.getBytesLoaded()>1) {
delete progressCheck.onEnterFrame;
loader_holder._x = 846.0;
trace("LEVEL: "+level+" "+"IS FULLY LOADED");
}
};
};
levelLoader("squares.swf", 9);
Why will this not work? The lev variable is not been read as a path but as a string. I have even used the [] operator to access the level but no joy. Can anyone help?
Is It Possible To Change A _level ?
hi
this is quite a simple question .... well, i hope so anyway :-))
suppose i have a swf on _level5, is it possible to change it to _level10 while the movie is playing ?
similarly, if i have a clip on a low layer in a movie, is it possible to move it to a higher layer (above everything) at runtime?
in fact i really just need to know if it's possible to change the stacking order of clips or MCs while the movie is playing ??
thanks for any illumination
Bob
_level Question
Hello,
i want to load some .swf files into my main flash movie.
Usually i load it to a MC in the same level.
Can i load it to a MC in another level? And if i do so, what are the advantages.
And if i load a MC to _level1, what happens when in that loaded file i use _root?
And, finally, how level1 interfeer with _level0?
Can u help me out in this?
What should i do?
Thanks,
Miguel
Doubt In Using _level
hi,
Basically I have 5 swfs being loaded into 5 movieclips on a click of 5 buttons respectively. Whenever the buttons are pressed the swf loads correctly into its assigned movieclip, but below other movie clips. For eg. when I press button 3 its swf hides below button 4 or 5's swf if they are already pressed. Then user has to close all other swfs witha close button placed there to view swf 3.
Is there a way by which I can use levels and make the movie which is loaded last to be loaded on top of all other movies? SwapDepths is not useful as the 5 windows are obtained only if user clicks all the five buttons.
_level Question
i have some basic knowledge and i don't now quite how to make this possible:
1). i made an swf called index.swf (this is my first file my browser loads.) (_level0).
2). i made an swf called contact.swf (this file must be loaded in an _level like > _level1 but after i pressed this button in my _root.nav movieclip . it must be rewind and then play the contact.swf file.
so in my root timeline i had put an movieclip "nav" in frame 100
in this movieclip i have separated buttons one of them is the button wich i want to load contact.swf file in _level1 . and after i pressed this button my movie must be rewind back and play menu.swf in my _level1.
can anybody help me out with this?....
regards Ray.
Mask With _level
I have game.
In this game i have levels.
In one of them i have movies attached, for example in _level2.
In _level1 I have a mask for all the members of the movie.
Ask
It will be masked the attached movies?
guess not
so
How to do it??????????????????
please
Marcelo
Brazil
Which _level Is The Movie In
I have a movie which needs to work standalone and also from a 'player' movie (which calls it onto _level100).
I want to be able to determine what level the movie is currently running from i.e.:
if it's on _level0 = it's standalone,
if it's not on _level0 = it's running from the 'player' movie.
I've tried using the following code:
if (this._level != _level0)//do stuff
but this._level always traces as _level0, even when the movie it's traced in is loaded onto a different level!
Basically is there any way to determine what level a movie is getting loaded into? I'd be grateful for any help.
Help With _level And Scale
I need some help on how to make a level open at like 33% and then zoom to the full 100% size.
When user clicks a start button:
function firsttown () {
loadMovieNum("town_long/town_long.swf", 1);
_level0._visible = false;
}
So, I'm trying to scale up town_long.swf as it opens. Not sure but think this would employ onClipEvent (enterFrame) { } some how.
Thanks for any ideas!
_level Problem
Hi,
i have main.swf who loads some.swf .
On first frame on some.swf i have AS: stop();
I want when i click on some button to loadMovieNum("some.swf", "5")
and to tell some.swf to play on frame 2.
I have tryed with this AS:
loadMovieNum("some.swf", "5")
_level5.gotoAndPlay(2);
Help?
Preloader Using _level
i am using multiple movies and i want to know how to create 1 swf with the preloader in it with the script on it that loads before the movie you click on, and i am having trouble with the script. i want the script to run when the button is clicked (like the sub button, links etc...)
i tryed this but im not sure its the right way.
code:
onClipEvent (load) {
total = getBytesTotal(_level1);
}
onClipEvent (enterFrame) {
loaded = getBytesLoaded(_level1);
percent = int(loaded/total*100);
text = percent+"%";
_level1.gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(_level1);
}
}
Usage Of _level
I have read through the tutorials for this but i don't exactly understand how exactly to code a .swf to load into _level1 on rollover for example. I have always used loadMovie but now i need transparency. Can anyone help me understand the usage of _level?
Controlling _level
i just have a swf loaded in a particular frame using
loadMovie("blah.swf",7);
i want to pause the movie from my main timeline, and i have a button in my root
and the code i have written on it is
on(press){
_level(7).stop();
}
but its not working, why ?
_level Problems
hi,
I need help about _levels, i have a movie and inside this movie i have lots of links, these links open(loadMovie) a second movie, i need send the movie to a especific frame, but dont work only i have is the 1st frame i try diferent code and stay the same.
on (release) {
loadMovie("2nd_movie.swf", 2);
_level2.gotoAndStop(28);
}
// dont work, stay in frame 1
on (release) {
loadMovie("2nd_movie.swf", 2);
gotoAndStop(28);
}
// dont work, stay in frame 1
on (release) {
loadMovie("2nd_movie.swf", 2);
gotoAndStop("teste");
}
// dont work, stay in frame 1
I think is because the 2nd_movie have lots of scrollpane's and all load a MC from the library, do u have a solution for this?
Pls help me.
Can You Move An _level?
Hi There,
I want to set the _x and _y position of an _level - is this possible, for example using
_level1._x = 10
or does it only work with a movie clip on a level?
i.e I want to load 10 movieclips into a level using loadMovieNum, then I want to move them all by a certain amount so the whole lot move - do I have to address them individually or can I move the level?
Thanks,
Lee
_level Help Have A MC On Top On Click
i have 4 MC (that are my pages) and they slide in to the scene from top, bottom,left,right
and i need to have a code that when you click on a btn it will put all the MCs but one _level0 and only one on _level1
is that possoble?? i dont know anything about _levels
your a life savor
thanks
_level Hack?
Don't ask why I need to do this, but is there a way of loading a clip from the library into another _level?
I can't use external .swf's.
Any help appreciated,
Dr.
_level Error?
I have a dynamic text box, and I'm trying to call the percentage loaded of an externally loaded .swf file. I know this is normally done as a preloader in the externally loaded swf, but I need to place it in the main movie. I used the following code in the first frame of the external swf:
total = getBytesTotal();
loaded = getBytesLoaded();
remaining = total-loaded;
_root.menuMC.catsMC.loadPercent = int((loaded/total)*100);
ifFrameLoaded(7) {
gotoAndStop(3);
}
In the main movie, "loadPercent" is the instance name of my dynamic text box (within a couple MCs). I keep getting "_level" in it until it's loaded, then it proceeds properly.
Does anyone have any advice on getting the percentage to appear there?
Thanks.
[MX] Grr... Another _level Issue
Well I've hit another scripting snag. For some reason I am unable to target a movieclip within a .swf file I've loaded with the loadMovieNum command. I've been trying to find the issue here for the last two days and I'm absolutely stumped. So here's part of the script. I've put *** where my main issue is.
PHP Code:
function battleview(areaname, enemynumber, enemy1name, enemy2name, enemy3name) {
function battleload() {
/*this will load the basic battle stuff and then load the enemies depending on enemynumber*/
loadMovieNum(areaname, 1);
loadMovieNum("battleinterface.swf", 9);
loadMovieNum("character.swf", 5);
if (enemynumber == 1) {
loadMovieNum(enemy1name+".swf", 2);
battlesetup();
}
if (enemynumber == 2) {
loadMovieNum(enemy1name+".swf", 2);
loadMovieNum(enemy2name+".swf", 3);
battlesetup();
}
if (enemynumber == 3) {
loadMovieNum(enemy1name+".swf", 2);
loadMovieNum(enemy2name+".swf", 3);
loadMovieNum(enemy3name+".swf", 4);
battlesetup;
}
}
function battlesetup() {
if (enemynumber == 1) {
//***here is the issue, for some reason it won't allow me to target _level5.character
_level5.character._x = 999;
}
}
battleload();
}
This is the basic set up of part of a game I've been working on this summer. It really just loads all the files.
|