Flash 6 And GetNextHighestDepth
for (i = 0; i < 3; i++) {
drawClip(i);
}
function drawClip(n:Number):Void {
this.createEmptyMovieClip("triangle" + n,this.getNextHighestDepth());
var mc:MovieClip = eval("triangle" + n);
mc.beginFill(0x00aaFF, 100);
mc.lineStyle(4, 0xFF0000, 100);
mc.moveTo(0, 0);
mc.lineTo(100, 100);
mc.lineTo(0, 100);
mc.lineTo(0, 0);
mc._x = n * 30;
mc._y = n * 50
mc.createTextField("label", this.getNextHighestDepth(), 20, 50, 200, 200)
mc.label.text = mc.getDepth();
}
How can i do this in flash 6 ... getNextHighestDepth is not working ...
any hint?
thanx in advance
ChromeD
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-09-2006, 06:35 AM
View Complete Forum Thread with Replies
Sponsored Links:
Flash MX 2004 Components, "this.getNextHighestDepth()"
Hi everyone
I was playing around with Flash MX 2004 components.
Has anyone noticed this problem, trying to remove a dynamically created Button? while using the "this.getNextHighestDepth()" function.
Code:
this.createObject("Button","cbtSubmit",this.getNextHighestDepth(),{_x:200,_y:200});
cbtSubmit.label = "testing 01";
this.destroyObject("cbtSubmit");
The following code creates the Button and labels it correcty. However it doesn't remove the Button
But if I replace "this.getNextHighestDepth()" with a number or variable then it removes the instance.
Thanks in advance
View Replies !
View Related
Flash MX 2004 Components, "this.getNextHighestDepth()"
Hi everyone
I was playing around with Flash MX 2004 components.
Has anyone noticed this problem, trying to remove a dynamically created Button? while using the "this.getNextHighestDepth()" function.
Code:
this.createObject("Button","cbtSubmit",this.getNextHighestDepth(),{_x:200,_y:200});
cbtSubmit.label = "testing 01";
this.destroyObject("cbtSubmit");
The following code creates the Button and labels it correcty. However it doesn't remove the Button
But if I replace "this.getNextHighestDepth()" with a number or variable then it removes the instance.
Thanks in advance
View Replies !
View Related
GetNextHighestDepth?
I have created an an actionscript, now I need another animation to run on top of it. I have imported the animation to my library as an swf and made it a movie clip, I then put an instance of my movie clip into a new layer on top of the actionscripted layer, giving the movie clip this code:
rec.swapDepths(_root.getNextHighestDepth());
rec is the instance name of my movie clip. I have achieved the correct depth, but now my movie clip does not animate, how can I preserve this animation while keeping it on top of the action scripted layer?
Thanks!~
View Replies !
View Related
GetNextHighestDepth Bug?
For some reason, getNextHighestDepth() only wants to work some of the time for me. Many times, for no reason it wil give my MC a negative depth value...usually inthe negative 16,000 range. Anyone ever see this before? What doesn this mean? Could this be just another effect of global warming?
View Replies !
View Related
GetNextHighestDepth
Hi,
I wonder why a movieclip is still visible in the next frame, when it has been given the getNextHighestDepth?
For instance with:
Code:
mc.onPress = function() { mc.swapDepths(this.getNextHighestDepth()); mc.startDrag(); }; mc.onRelease = function() { stopDrag(); }; stop();
on the first frame, and then when the movie goes to the next frame the mc is still there.
How come?
thank you,
Jerryj.
View Replies !
View Related
Going Above GetNextHighestDepth
I'm loading a component findDrop.swf using this code
_root.createEmptyMovieClip("empty",_root.getNextHi ghestDepth());
empty._lockroot = true;
empty._x = 275;
empty._y = 102;
empty.loadMovie("findDrop.swf");
this is on the top level.
How do i get an existing MC object in the same main movie to sit above this dynamically generated MC?
Cheers Rat
View Replies !
View Related
GetNextHighestDepth()
I've been using getNextHighestDepth to place new mc's in my game
Unfortunately, I want these to come in underneath other movie clips, and I just found that getNextHighestDepth just returns a depth higher than the highest, rather than returning the lowest available depth. Is there a function that does that instead?
ex:
I have depths 0, 1, 2, 3, 5, 100, and 101 occupied. I need a function that will return 4.
I was thinking, to avoid all of this, I could put the mc's that I need on the top into a higher level, but from what I understand, you can only use levels when loading an external movie?
View Replies !
View Related
Help With GetNextHighestDepth
I am making a game with zombies that keep coming through a door. when they have entered the door I a using a hit test so they don't walk through the walls. the problem is I am using
Code:
for (i=0; i<_root.myGuy.numZ; i++) {
this.attachMovie("zombieHolder", "holder"+i, this.getNextHighestDepth());
}
to generate the zombies. so the zombies are not hitting the walls that are at a lower depth. does any one know how to fix this?
View Replies !
View Related
Help With GetNextHighestDepth()...
on (release) {
container1.attachMovie("pic2","newname1",container 1.getNextHighestDepth());
}
This is on a button within a movieclip that is part of an infinite menu of pics. The container1 movieclip is on the main stage. It is not working...pic1 is linked and all that, so I'm not sure what's wrong.
HELP!
View Replies !
View Related
GetNextHighestDepth()
Yes, I know it's not AS2.
That's why I am asking...
What would I use instead?
I want to attach a movie with AS, but it has to be infront of the movie it's being attached to... or attached to the front.
I have used "bring to front" before but I remember it slowed down my interface.
So what do I use???
View Replies !
View Related
GetNextHighestDepth()
Code:
//_quality = "LOW";
import flash.filters.BlurFilter;
import mx.transitions.Tween;
import mx.transitions.easing.None;
//define number of layer.
var layer = 20;
//number of items in a layer
var items = 4;
//create the bg that holds the layers
this.createEmptyMovieClip("bgHolder", this.getNextHighestDepth());
//this function will update the layers current position
function updateMovies() {
//easingStrenth
d = 5;
this.x = _root._xmouse;
this.y = _root._ymouse;
//get the linear relation fo x.
var coef = (Stage.width-this._width)/Stage.width;
//update x with easing.
this._x -= (this._x-coef*this.x)/d;
//get the linear relation fo y.
coef = (Stage.height-this._height)/Stage.height;
//update y with easing.
this._y -= (this._y-coef*this.y)/d;
}
//init function for the layers
function init() {
for (i=0; i<layer; i++) {
//create a layer
var temp = this.bgHolder.createEmptyMovieClip("bg"+i, this.bgHolder.getNextHighestDepth());
depth = temp.getNextHighestDepth();
//create a virtual bag for the layer to define it height and width.
virtual_mc = temp.attachMovie("virtual", "vitrual"+depth, depth, {_visible:false, _width:(i)*Stage.width/4, _height:(i)*Stage.height/4});
//put the items into the layer
for (j=0; j<items; j++) {
for(a=1;a<=8;a++){
theHigh = _root["float"+a];
theHigh.thisNum = a ;
depth = temp.getNextHighestDepth();
//attach an item
var theHigh = temp.attachMovie("float"+a, "float"+depth, depth);
//position it randomly in the current layer
theHigh._x = Math.random()*(i+2)*Stage.width;
theHigh._y = Math.random()*(i+2)*Stage.height;
theHigh._rotation = Math.random()*Stage.height;
//scale it randomly
rand = Math.random();
theHigh._xscale *= .5+rand;
theHigh._yscale *= .5+rand;
//put is opacity randomly
//theHigh._alpha = random(80)+50;
//blur
var blur:BlurFilter = new BlurFilter(1*Math.random(), 1*Math.random(), 1*Math.random());
for (var b:Number=0; ++b<=6; ) theHigh.filters = [blur];
}
//each layer share the same updating function.
temp.onEnterFrame = this.updateMovies;
}
}
}
init();
I am having problems to place on the highest level the cursor which was created for my mouse.
Looking to the code I can image why this is happening. The code is creating and duplicating layers of MCs, placing it over (in a highest level) the previous one.
Code:
onClipEvent (load){
Mouse.hide();
}
onClipEvent (mouseMove) {
setProperty (this, _x, _root._xmouse);
setProperty (this, _y, _root._ymouse);
this.getNextHighestDepth()
updateAfterEvent(mouseMove);
}
For the cursor I have this code.
Even placing this.getNextHighestDepth() the cursor will be under the duplicated layers.
How can I control the level of these duplicated layers and place any MC over it? Ahh, and reminding that I need to keep the loop.
Cheers,
Diego
View Replies !
View Related
GetNextHighestDepth
Okay, I posted this problem a while ago, but thought I had a solution. It works sometimes, but not all the time. I have made a drawing application, and whatever you draw is drawn using getnextHighestDepth, so its always on top. Now, I am using custom cursors I made, and when you draw a shape, the cursor goes behind whatever you draw. So this is what I tried:
_root.createEmptyMovieClip("Cursor", getNextHighestDepth());
_root["Cursor"].swapDepths(_root["paintBrushCursor"]);
removeMovieClip(_root["Cursor"]);
Now, this kind of works, sometimes. What I was hoping it would do is create an empty movie clip after the shape has been created, then swap the cursor with the cursor (which should be at the highest depth), so it would be on top, then delete that movieclip. So the next time they make something, it makes another empty movie clip to swap, thn deletes it as well. What happens you make a shape, and the cursor stays behind, but you make another and it appears on top, then you make another and it appears behind again, etc. Any idea how I'd make this work, so the cursor always stays at the highest depth?
View Replies !
View Related
Help With Xml And GetNextHighestDepth
I have a thumbnail gallery that is called in with xml- On stage is a movieClip that covers the entire thumbnail area with the alpha set to 0. what I'm trying to do is onRelease- have that mc brought to the front and it's alpha state tween to 100- i've not much experience using 'getNextHighestDepth' so I'm assuming something is wrong here... if anyone can help I'd really appreciate it!
Thanks!
Attach Code
target_mc.onRelease = function() {
stageFade_mc.getNextHighestDepth();
TweenLite.to(stageFade_mc, 3, {_alpha:100});
loadMovieNum(view[p], 5);
};
View Replies !
View Related
GetNextHighestDepth
Hello,
I am having a small problem with the getNextHighestDepth function. I have multiple movie clips on stage (a deck of cards). Clicking on any movie clip will start dragging it, and bring it to the top of the pile. Problem is, I can click a card near the bottom of the deck, it will come to the top fine, but other mc's will also come forward in front of others in the pile. Why does this happen?
Here's my code for a couple of the cards...
Attach Code
cardFilingCabinet_mc.onPress = function() {
cardFilingCabinet_mc.swapDepths(this.getNextHighestDepth());
startDrag(this);
};
cardFilingCabinet_mc.onRelease = function() {
stopDrag();
};
cardAccountant_mc.onPress = function() {
cardAccountant_mc.swapDepths(this.getNextHighestDepth());
startDrag(this);
};
cardAccountant_mc.onRelease = function() {
stopDrag();
};
cardArchitect_mc.onPress = function() {
cardArchitect_mc.swapDepths(this.getNextHighestDepth());
startDrag(this);
};
cardArchitect_mc.onRelease = function() {
stopDrag();
};
View Replies !
View Related
GetNextHighestDepth
Hello,
I need some guidance on getting getNextHighestDepth to work for my file. I have a deck of cards that I want the user to be able to flip through. When the user clicks on a card, it flips over. I have tried using
myCard.onRelease=function(){
this.getNextHighestDepth();
}
I'm wondering if I need to dynamically place instances of myCard onto the stage to get this to work, or if all my cards can be placed on the same layer on the main timeline, and they can be controlled from there.
Here are my swf and fla files.
Any help greatly appreciated. If you look at the files, you will see that they are somewhat complex with the way they are set up to animate properly. This, I think, is what's confusing me when it comes to writing my code so that it affects the proper place.
Cheers,
P
Edited: 01/22/2008 at 08:50:59 AM by Mister Peanut
View Replies !
View Related
GetNextHighestDepth?
Here is some simple code I am using to try to put two yellow blocks on the screen. I can't seem to get the getNextHighestDepth function to work. What am I doing wrong here? I have tried using this.getNextHighestDepth() and _root.getNextHighestDepth(); If I use the blocks number which increments, both show up so they are on different depths, but I'd like to use the automatic number.
How do I use this function?
Code:
Block = function(shape,x,y){
this.shape = shape;
this.clip = _root.attachMovie(shape, "block_"+_root.blocks, this.getNextHighestDepth());
this.clip._x = x;
this.clip._y = y;
_root.blocks++;
trace(this.clip);
trace(this.clip._depth);
};
blocks = 1;
b = new Block("block",0,0);
b = new Block("block",35,0);
Output:
_level0.block_1
undefined
_level0.block_2
undefined
View Replies !
View Related
GetNextHighestDepth
Hi
I followed the XML drop down tutorial and managed to get the system working fine, however when I have applied this method to my own project I have found a problem.
The original tutorial uses a depth of 0 when creating the menu item:
var curr_menu = container.createEmptyMovieClip(name, depth);
This means the menu items were being placed under another movieclip which is being created programmatically.
My solution was to replace the original depth with getNextHighestDepth:
var curr_menu = container.createEmptyMovieClip(name, this.getNextHighestDepth());
This appeared to work fine,the menu now appeareed above the other movieclip, until I realised the menu rollovers wouldn't work after loading the menu a number of times (I load the menu onRelease of a button).
Any help would be much appreciated.
Scott
View Replies !
View Related
GetNextHighestDepth Problem
Hi
I am dynamically loading images from a database..three different rows for three different queries.. i can see all the images load but then a couple will dissapear becuase they are in line with images on a different row... to make more sense ive created a mock up version with a couple of images and text file as the dynamic part..
it can be download @
http://www.geocities.com/mrsigma/FlashStore.zip
Any help would be greatly appreciated.
View Replies !
View Related
GetNextHighestDepth() Function
I just trying to simply place two instances of the same movie clip (circle) onto my home section of the site and the getNextHighestDepth() is messing me up. When I use it, only the second instace (cirB) shows up. I thought this function was supposed to make sur nothing is on the same level? When I add a depth area to the function and then put 1 and 2 in each of the areas where I call the function, it works. But this is unnecessary hard coding.
code:
var r = _root;
w = Stage.width;
h = Stage.height;
var highestDepth = 0;
Stage.scaleMode = "showAll";
var ballFade = true;
var swigleFade = true;
dep = _root.getNextHighestDepth();
//-------------------------------
r.createEmptyMovieClip("home", getNextHighestDepth());
//--------
function fadeCircle(originalitem,newitem,xpos,ypos,opacity)
{
home.attachMovie(originalitem,newitem, dep);
home[newitem]._x = xpos;
home[newitem]._y = ypos;
//home[newitem]._alpha = 0;
//if (home[newitem]._alpha <= 100)
//{home[newitem]._alpha += opacity
//}
}//end function
//--------------------------------------------------
home.onEnterFrame = function()
{ var cirGap = 40;
if (ballFade == true)
{
fadeCircle ("circle","cirA", 150, 250, 10);
fadeCircle ("circle","cirB", 20, 50, 10);
}// end if
}// end on enter frame
View Replies !
View Related
Problems With GetNextHighestDepth
As seen here: http://www.bllets.dk/ots/flash/index.swf i have 12 pictures, which will enlarge when the mouse rolls over them, and shrink when the mouse is away agian. And is above the others when the mouse is over..
The code for the buttons are:
Code:
reklame_btn.stop()
reklame_btn.onRollOver = function(){
this.swapDepths(getNextHighestDepth());
reklame_btn.play(1)
}
reklame_btn.onRollOut = function(){
reklame_btn.gotoAndStop(1)
}
And it works fine.... except, i have now added:
Code:
reklame_btn.onRelease = function(){
// Create window.
import mx.styles.CSSStyleDeclaration
import mx.managers.PopUpManager
import mx.containers.Window
var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true, {closeButton:true, titleStyleDeclaration:"TitleStyles",contentPath:"flash/opg1/BienAlbert.swf"});
// Set window attributes.
my_win.title = "Bien Albert - Tweening";
my_win.setSize(800, 600);
my_win.move(0, 0);
// Create listener object.
var winListener:Object = new Object();
winListener.click = function(evt_obj:Object) {
trace("closing window");
evt_obj.target.deletePopUp();
};
// Add listener.
my_win.addEventListener("click", winListener);
};
To create a window with the SWF file which belongs to each picture/button. But since i use getNextHighestDepth on the pictures, the are over the window when it opens.
I have tried to do some works around, but most end up doing nothing at all... Others make the pictures not get higher then the ones around...
So anyone know a work around ?
fla file: http://www.bllets.dk/ots/flash/index.fla
Edit: Using AS 2.0 and Macromedia Flash 8
View Replies !
View Related
GetNextHighestDepth Problems
I have a movie into which I am loading five other movies. The movies are loading in exactly the same location but I want to make the most recently loaded movie show on the top level every time.
For example, if I press the "designingbutton" I want the "Quest Wall Animation.swf" to load on the top level.
If I then press the "specifyingbutton" I want the "Directions Wall Animation.swf" to load OVER the "Quest Wall Animation.swf".
If I then press the "designingbutton" a second time I want the "Quest Wall Animation.swf" to reload into a level above, or on top of, the level into which the Quest Wall Animation.swf" was loaded.
I know very little about ActionScripting but here is what I have thus far:
this.createEmptyMovieClip("holder_mc", getNextHighestDepth());
this.createEmptyMovieClip("holder_mc2", getNextHighestDepth());
this.createEmptyMovieClip("holder_mc3", getNextHighestDepth());
this.createEmptyMovieClip("holder_mc4", getNextHighestDepth());
this.createEmptyMovieClip("holder_mc5", getNextHighestDepth());
menumovie.designingbutton.onPress=function(){
holder_mc.loadMovie("Quest Wall Animation.swf");}
menumovie.specifyingbutton.onPress=function(){
holder_mc2.loadMovie("Directions Wall Animation.swf");}
menumovie.installingbutton.onPress=function(){
holder_mc3.loadMovie("Tonga Wall Animation.swf");}
menumovie.ownershipbutton.onPress=function(){
holder_mc4.loadMovie("Spin Wall Animation.swf");}
menumovie.mediabutton.onPress=function(){
holder_mc5.loadMovie("Silhouette Wall Animation.swf");}
I am creating empty movie clips for each movie and then (supposedly) asking it to bring that empty movie clip, with the loading movie) to the top level.
When I press the buttons the script loads the movies as it is supposed to but it does not bring the most recently loaded movie to the top level.
Can someone help me figure out what I am doing wrong?
I know to some guru out there this will be easy but to a novice like me it's confusing.
Thanks, in advance, for your assistance.
View Replies !
View Related
GetNextHighestDepth Question..
Hi I'm trying to get my eternal swf onto the top level of my movie, at the moment I'm scratching my head. This is what I've come up with so far:
Code:
mcEmpty07.onRelease=function(){
mcEmpty07.swapDepths(_root.getNextHighestDepth());
}
Not thrilled on using an onRelease function would I be able to use something like this instead:
Code:
var vWhoAmI:Boolean = false
onEnterFrame = function() {
if(vWhoAmI == true)
mcEmpty07.swapDepths(_root.getNextHighestDepth());
}
And on the 2nd frame of the animation place
Code:
vWhoAmI = true
What do you think? Any help would be great
View Replies !
View Related
GetNextHighestDepth Issue
Hi All
I have a a for loop in a for loop building a grid. the first for loop gets the row the second builds the cells in the row. really pretty simple. but the problem I am having is a levels one. when I try to use getNextHighestDepth() to set the level of each new text field (cell in my grid) it over rides the previous. Its like getNextHighestDepth() is not working. when I trace(getNextHighestDepth()) it gives the same depth for each iteration of the loop what is am I doing wrong.
ActionScript Code:
var xPos:Number = 85;
for (var i = 0; i < capsXML.firstChild.childNodes.length; i++) {
this.gridContainer.createTextField ("rName" + i,1002 + i,xPos,0,65,20);
this.gridContainer["rName" + i].text = capsXML.firstChild.childNodes[i].attributes.dName;
this.gridContainer["rName" + i].setTextFormat (labelFmt);
var yPosSub:Number = 20;
trace("--------------")
for (var q = 0; q < capsXML.firstChild.childNodes[i].childNodes.length; q++) {
//trace (capsXML.firstChild.childNodes[0].childNodes[q].lastChild);
trace(xPos+" } "+yPosSub+" d "+(this.getNextHighestDepth()+1))
this.gridContainer.createTextField (i+ "xAtt" + q ,this.getNextHighestDepth()+1,xPos,yPosSub,65,20);
this.gridContainer[i+ "xAtt" + q].text = capsXML.firstChild.childNodes[i].childNodes[q].lastChild;
this.gridContainer[i+ "xAtt" + q].border = true
this.gridContainer[i+ "xAtt" + q].setTextFormat (attFmt);
yPosSub += 20;
}
xPos += 65;
}
View Replies !
View Related
GetNextHighestDepth() Problem
i have two movies, each with a movieclip on the _root level and this line of actionscript on the main timeline:
trace (clipName.getNextHighestDepth());
the only problem is, in one movie the trace returns '0' (as i expected), but in the other it returns 'undefined' - which is strange, because as far as i can tell, the movies are identical in all but the actual names of the clips (and the shapes they contain, but that shouldn't make a difference).
i've uploaded the two movies in case anyone wants to take a look. i'm sure i'm overlooking something really simple but i can't see why one getNextHighestDepth() returns 'undefined'.
test1.fla
test2.fla
thanks in advance
||| O ^ | + O ¬
View Replies !
View Related
DepthManager VS. GetNextHighestDepth()
Hello everyone...
Can someone explain to me the difference between those two... I have a problem where i'm sending data to the screen and i need to refresh twice to get the data to display... i was thinking it has to be a depth problem here as when i comment this out it works fine
Code:
textContainerMovieClip.createClassObject(mx.controls.ComboBox, "courseLanguageInput", textContainerMovieClip.getNextHighestDepth());
textContainerMovieClip.courseLanguageInput._lockroot = true;
textContainerMovieClip.courseLanguageInput.move(200, yPosition);
textContainerMovieClip.courseLanguageInput.setSize(100, 22);
textContainerMovieClip.courseLanguageInput.dataProvider = [{label:"English", data:"eng"}, {label:"French", data:"frn"}, {label:"Spanish", data:"sp"}, {label:"Portuguese", data:"prt"}, {label:"Japanese", data:"jpn"}];
textContainerMovieClip.courseLanguageInput.selectedIndex = returnLanguageCode(manifestOptions.courseLanguage);
var courseLanguageInputListener:Object = new Object();
courseLanguageInputListener.change = function(evt_obj:Object) {
manifestOptions.courseLanguage = evt_obj.target.selectedItem.data;
trace("Selected language is: " + manifestOptions.courseLanguage);
};
textContainerMovieClip.courseLanguageInput.addEventListener("change", courseLanguageInputListener);
View Replies !
View Related
GetNextHighestDepth Problem
I have a problem.
I have created 14 movie clip buttons. Each button has a roll over effect when you mouse over. When you mouse over there is a graphic that gets bigger and then gets smaller when you roll out. The problem is each movie is on it's own layer and when I roll over a movie, one will zoom under a movie and hide the image and if I put the movie on top of that movie's layer it'll cause the same problem for a diffrent one so on and so forth.
I've tried placing this code one the first frame where the clips reside
movieclip.getNextHighestDepth()
and this one too
movieclip.swapDepths(_root.getNextHighestDepth());
but it doesn't always work. How can I get the clips to zoom on top of each other as you mouse over each individual one?
Edited: 02/18/2007 at 10:03:00 AM by Asesino
View Replies !
View Related
_scale And GetNextHighestDepth();
Hey guys,
Working on a Flip Book development, and after nailing the zoom / pan feature, then the double page, front & back animation feature (coded separately) I ran into a bump. My zoom feature will only rescale any objects that do not have the getNextHighestDepth property (All objects are on the same layer, inside the same movieclip).
I have used getNextHighestDepth() for the pages, so I'm assuming the problem lies here (I have tested stationary pages in the same layer and they zoom / pan fine)
P.S the movement by 660 pixel pulls the drag button back on stage (both sections work perfectly, when they aren't together)
Any help hugely appreciated.
TIA,
Peter McConnell
CODE AS FOLLOWS:
Attach Code
//on the content area mc:
onClipEvent(load){
bounds = {L:-340, R:0, T:-200, B:0}
_global.dragstate = "off";
}
onClipEvent(mouseMove){
if(_global.dragstate=="on"){
if (dragging){
center._x = Math.min(Math.max(_xmouse - offset[0],bounds.L),bounds.R)
center._y = Math.min(Math.max(_ymouse - offset[1],bounds.T),bounds.B)
updateAfterEvent();
}
}
}
//initiate scale function:
onClipEvent(load){
function SetScale(num){
_root.scale = _root.map._xscale = _root.map._yscale = 100 * num;
}
SetScale(1);
}
//zoom in:
on(rollOut){
this.button_overlay_mc.gotoAndStop(1);
}
on(release){
SetScale(2);
this.gotoAndStop(2);
_root.dragbutton._x = _root.dragbutton._x+660;
_global.dragstate="on";
_root.iszoom.gotoAndPlay(2);
}
View Replies !
View Related
GetNextHighestDepth Not Really Working
I have a flash movie with some buttons that load swf's into the movie. Here is the code I have attached to the buttons:
on(press){
var container:MovieClip = this.createEmptyMovieClip("weddingClip", this.getNextHighestDepth());
weddingClip.loadMovie("wedding.swf");
}
This actually works fine the first time. The problem is that if I press button 1 and it loads the appropriate swf, then I press button 2 and it loads it's appropriate swf, if I decide to go back to 1, it won't come up because it is loaded below #2. I would think it would still come up in depth.
Here is the link to the site for demonstration purposes:
test site
Any ideas?
View Replies !
View Related
GetNextHighestDepth Insanity
Hello,
Some months ago, I started a project involving clicking on a card, and having in flip over. I've finally solved the animation end of this project, but I have been stuck quite some time on putting multiple cards into a deck, pressing on the top card, having it flip to the side, and clicking on the next card, and so on.... I want each card to go to the top of the deck when pressed, and flip over. Here is a link to my file; please look at it as there are some nested animations that are absolutely necessary for the animation to look realistic:
Card Flip
Each card is a movie clip contained within a movie clip. I use the following code to flip the card back and forth:
filingCabinet.flipFilingCabinet.onRelease=function(){
filingCabinet.gotoAndPlay(2);
filingCabinet.flipFilingCabinet.gotoAndPlay(2);
filingCabinet.getNextHighestDepth();
}
The problem I'm having is that the cards seem to go in any order when flipping them back and forth, whereas I need the card that is clicked on to be on top of the deck always. Not sure why my code does not work. Any help, is really, really appreciated. I have had others look at the code who know javascript, but this is a different ballgame, and my skills are not enough to figure out why this isn't a simple matter to solve. As I said, my skills are not so good, so an example with y code would help me out best in understanding why this doesn't work. Chances are, if you just tell me something like "use x method" I will have no idea how to implement it. Extra explanation is greatly appreciated as I have been trying to figure this out for weeks...
Cheers in advance
P
View Replies !
View Related
GetNextHighestDepth() Problem
i have two movies, each with a movieclip on the _root level and this line of actionscript on the main timeline:
trace (clipName.getNextHighestDepth());
the only problem is, in one movie the trace returns '0' (as i expected), but in the other it returns 'undefined' - which is strange, because as far as i can tell, the movies are identical in all but the actual names of the clips (and the shapes they contain, but that shouldn't make a difference).
i've uploaded the two movies in case anyone wants to take a look. i'm sure i'm overlooking something really simple but i can't see why one getNextHighestDepth() returns 'undefined'.
test1.fla
test2.fla
thanks in advance
||| O ^ | + O ¬
View Replies !
View Related
.getNextHighestDepth Problem
hi i am in the middle of making a flash rpg and i am starting out with tiles i was using some code i found on here now i am stuck i think the code i have been using is for MX 2004 not MX which is what i have so i was wondering if there was a subsitute for the code
this.getNextHighestdepth()
if u want to know what the code fully is its the rpg programming under actionscript page 6
mvWdth = 320;
mvHght = 320;
tileWdth = 16;
tileHght = 16;
itemMap1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
function placeItems(map) {
_root.attachMovie("blank", "items", this.getNextHighestDepth());
var mapWdth = map[0].length;
var mapHght = map.length;
for (var i = 0; i<mapHght; i++) {
for (var j = 0; j<mapWdth; j++) {
switch (map[i][j]) {
case 1:
_root.items.attachMovie("ryu_mc", "ryu_mc", d++);
_root.items.ryu_mc._x = (_root.tileWdth* j);
_root.items.ryu_mc._y = (_root.tileHght* i);
}
}
}
}
placeItems(itemMap1);
mvWdth = 320;
mvHght = 320;
tileWdth = 16;
tileHght = 16;
tile0 = function () { };
tile0.prototype.pos = 1;
tile0.prototype.barrier = false;
tile1 = function () { };
tile1.prototype.pos = 2;
tile1.prototype.barrier = true;
tile2 = function () { };
tile2.prototype.pos = 3;
tile2.prototype.barrier = true;
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
function MapMaker(map) {
_root.attachMovie("blank", "tiler", d++);
var mapWdth = map[0].length;
var mapHght = map.length;
for (var i = 0; i<mapHght; i++) {
for (var j = 0; j<mapWdth; j++) {
var name = "tile_"+j+"_"+i;
_root[name] = new _root["tile"+map[i][j]]();
_root.tiler.attachMovie("tileset1", name, i*100+j*2);
_root.tiler[name]._x = (j*_root.tileWdth);
_root.tiler[name]._y = (i*_root.tileHght);
_root.tiler[name].gotoAndStop(_root[name].pos);
}
}
}
MapMaker(map1);
please anyhelp people can give me would be appricianted i need to figure out what i am doing wrong or if there is a subsitute for the .getNextHighestdepth() code
Im using Macromedia Flash MX not Macromedia Flash MX 2004 just so you know
well i shall be waiting thanks in advanced
View Replies !
View Related
This.getNextHighestDepth() Problems
Hello all, I'm trying to make a navigating where I have a empty MC that is to have movies from the library loaded into it. The empty MC has a movie loaded into it when you enter the frame (using onEnterFrame) and once you click a button, another movie is meant to take its place (using attachMovie). The problem is, I can't seem to control the depths. As there is to be more library movies loaded into the empty MC, I want to use something like the "this.getNextHighestDepth()" rather than using numbers.
Can anyone help please!?
View Replies !
View Related
Unload GetNextHighestDepth
how do i load a movie clip SYMBOL at the highest level and then unload it.
i dont want a SFW or JPG to be loaded- that would be one of the symbols from the same swf file.
the issue is- i have used "getNextHighestDepth()" to create movie clips.. now i need to add a box on top of that- so again, i will have to use "getNextHighestDepth()" - which im having hard time to unload (when i use duplicateMovieClip) -
PLEASE HELP- i spent all day yesterday to resolve it.
View Replies !
View Related
GetNextHighestDepth() Problem
i have two movies, each with a movieclip on the _root level and this line of actionscript on the main timeline:
trace (clipName.getNextHighestDepth());
the only problem is, in one movie the trace returns '0' (as i expected), but in the other it returns 'undefined' - which is strange, because as far as i can tell, the movies are identical in all but the actual names of the clips (and the shapes they contain, but that shouldn't make a difference).
i've uploaded the two movies in case anyone wants to take a look. i'm sure i'm overlooking something really simple but i can't see why one getNextHighestDepth() returns 'undefined'.
test1.fla
test2.fla
thanks in advance
||| O ^ | + O ¬
View Replies !
View Related
Is There An Opposite Of GetNextHighestDepth() ?
I need something to set the lowest depth...
At the moment I'm using this var mc:MovieClip = this.createEmptyMovieClip("mc", -16384);
But this is not so beautiful...
And one more question about depths... For example if this mc is placed on the -16384? is it possible that something will be placed there again?
View Replies !
View Related
GetNextHighestDepth Replacement?
The getNextHighestDepth function has some real problems when working with components (the DepthManager). As a workaround I've written a static method that just adds a number to a static Number and returns it.
ActionScript Code:
private static var __nextDepth:Number = 1;
public static function getHighestDepth() {
return __nextDepth ++;
}
What do I actually lose by doing this? I seems to work ?
View Replies !
View Related
_root.getNextHighestDepth()
_root.getNextHighestDepth() doesn't seem to give me the highest depth? I have loads of MC:s and calls this from within one of them rather far down by: this.swapDepths(_root.getNextHighestDepth());
Should this place above everything else?
Richard
View Replies !
View Related
Alternative To GetNextHighestDepth And DuplicateMovieClip?
I am trying to develope something for an xda2 or pocketpc. I'm pritty sure that getNextHighestDepth() and duplicateMovieClip() wont work with flash player 6. I need a different way of doing it, HELP?
e.g. (code at the moment)
dp = getNextHighestDepth();
duplicateMovieClip(movieplayer,"movieplayer" + dp,dp);
Its either find another way to do the above or wait for macromedia to release flash player 7 for the pocket pc. I need to sort this! will have a really cool application if it wasnt for this. (scene genarater controled by xml data reading)
View Replies !
View Related
GetNextHighestDepth() Acting Funky
This was a real hair-tearer.... almost drove me to tears, heh.
I am making this flash movie to prototype a design, and was trying to call removeMovieClip() on one of the clips on _root. it REFUSED to get off my screen.
After much searching however, I realized the problem: getNextHighestDepth(), which i used to create the movieclip instance with attachMovie(), was acting weird (as many of you know, if the depth's too humongously high, removeMovieClip will not work). I did an output of the next highest depth BEFORE any code (frame 1, first line of the movie), and it was giving a depth reading of *gasp*...
1048576
um... i thought _root was supposed to start at depth of 0? what's with the humongous size? Has anyone ever encountered this problem before?
Thanks for ANY help at all! (please?)
View Replies !
View Related
[MX04] GetNextHighestDepth Not Working
Hi all,
In the following code I try to load jpg's in a holder movie clip on different depths (I want to display them next to each other.) I use the getNextHighestDepth method in this function:
Code:
function make_stream(mc_name){
stream_mc.holder_mc.createEmptyMovieClip(mc_name+"_1", this.getNextHighestDepth());
stream_mc.holder_mc[mc_name+"_1"].loadMovie(mc_name+".jpg");
// scale jpg
stream_mc.holder_mc[mc_name+"_1"]._xscale = stream_mc.holder_mc[mc_name+"_1"]._yscale = 31;
// position jpg
stream_mc.holder_mc[mc_name+"_1"]._x = (stream_array.length-1)*76;
trace("mc: "+stream_mc.holder_mc[mc_name+"_1"]);
trace("depth: "+stream_mc.holder_mc[mc_name+"_1"].getDepth());
}
The trace actions above generate this output:
mc: _level0.stream_mc.holder_mc.mov0_1
depth: 0
mc: _level0.stream_mc.holder_mc.mov1_1
depth: 0
mc: _level0.stream_mc.holder_mc.mov2_1
depth: 0
As you can see all the mc's are created on depth 0, so just one jpg is visible at a time. What am I doing wrong?
Thanks very much for your time.
View Replies !
View Related
[F8] ComboBox No Worky W/ GetNextHighestDepth
Greetings,
I'm building a series of simulations/tutorials around installing and using some of our products. I've captured a bunch of gifs that I've turned into movie clips with buttons, text fields and comboboxes.
As I advance throught the simulation, I add movie clips with attachMovie and use getNextHighestDepth for the level. Everything works great except for the freakin' comboboxes. When I click on them, they highlight green, but they don't give me the drop down list to choose a selection.
Now if I hardcode in the levels (instead of using getNextHighestDepth), the comboboxes work just fine. The problem is that each simulation has 30 - 50 movie clips that pop in and out . . . and it's a real pain to go back and re-adjust all of the levels manually if I need to insert another movie clip in the middle
Thanks!
View Replies !
View Related
This.swapDepths(this.getNextHighestDepth()); Too Sensitive
I'm creating a quiz using action script 2.0. It has a few drag and drop questions. I used this.swapDepths(this.getNextHighestDepth()); to make the current dragged movieclip come to the front. The problem i'm having is when you move on to the next question, the last movie clip you clicked on stays on the stage. Anyway of getting around this but still have the movie clip go on top of its frame only?
View Replies !
View Related
Container1.getNextHighestDepth() NOT WORKING
Hello all,
So I'm still working on this damnable infinite scrolling menu. As it stands now, I have buttons nested in a movieclip. The buttons, when pressed, should load a movieclip into container1 on the main stage. When I place the buttons on the main stage (so that they aren't nested), the movieclips load with no problem. As soon as I nest them in the movieclip (the infinite menu), they no longer work. I've tried different depths, and...NOTHING! Argh...
here's the button code as of this moment:
on (release) {
container1.attachMovie("pic2","newname1",container 1.getNextHighestDepth());
}
Any help would be greatly appreciated. Thank You all for the help you've provided to date.
QV
View Replies !
View Related
|