ActionScript 2.0 :: Change Depth To A Negative Number?

Mar 25, 2010

I have a stack of 3 Mcs, 1, 2 and 3, one over the other, at the same layer.

I want to make an action, that makes the top level MCs, when clicked, to go under the other 2 MCs, and so on.

Is it possible? I tried to make it, but discovered that it's not possible to define negative depth for a MC.

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Change Number To Negative?

Jan 25, 2009

how to turn a variable number from positive to negetive using AS2? eg:

Code:
myVar1 = 40;
//use code to change to negetive number
myVar1 = -40;

View 4 Replies

ActionScript 3.0 :: Check If A Negative Number Is Less Than Another Negative Number?

Jul 17, 2011

check if a negative number is less than another negative number. The if condition logic seems to be in order as far as i can tell but it doesent work for some reason :

Code:
public function minuscheck(testnumber:int):void
{
if (testnumber < -1)

[code]....

View 6 Replies

ActionScript 2.0 :: Dynamic ComboBox Is Giving Negative Depth To Attached MovieClip?

Jun 17, 2007

I've got this new problem where I'm trying to remove a container movieclip i've attached the first time the function is run, but I try to remove it and replace it again, but the second time around it gets a negative depth and all goes to hell.

Code:

function populateBasket(){
trace("B4 REMOVE:" + basketRows.loader.container.getDepth());
basketRows.loader.container.removeMovieClip();

[Code].....

View 1 Replies

ActionScript 2.0 :: Find Out If Number Negative?

Jun 6, 2008

I need to check if a number is negative and if so, trace "true" and if not "false".

View 2 Replies

ActionScript 3.0 :: Negative Random Number Not Recognized?

Aug 15, 2009

I'm working on a AS3 project where users will decide whether a random number is whole number or not.There are three boxes (box1, box2, box3), which will display random numbers. Under each box there are two check buttons (for example: bt1 and bt2).There are also two boxes counting correct and incorrect answers (correct1 and correct2). There is a button generating random numbers again (bt_2).The negative random numbers are not recognized by my conditional. Or I don't know how to handle conditional with negative numbers. Positive or negative numbers display the correct check mark? Here is my AS3

//counters
var i:uint=0; // correct answersvar u:uint=0; // incorrect answers
// making check mark invisibleco1.visible=false; // correctco2.visible=false; [code].....

View 2 Replies

ActionScript 3.0 :: Negative Random Number Not Recognized

Aug 15, 2009

I'm working on a AS3 project where users will decide whether a random number is whole number or not.

There are three boxes (box1, box2, box3), which will display random numbers. Under each box there are two check buttons (for example: bt1 and bt2).

There are also two boxes counting correct and incorrect answers (correct1 and correct2). There is a button generating random numbers again (bt_2).[code]...

View 9 Replies

ActionScript 2.0 :: Convert A Negative Number Into A Positive?

Nov 13, 2007

Is there a way to convert a negative number into a positive using actionscript?

View 5 Replies

ActionScript 3.0 :: Lineheight In TLFTextField Is Getting Set To A Very Large Negative Number?

Aug 24, 2010

how or why it is happening??
 
example:
 
var myText:TLFTextField = new TLFTextField();
//lots of initialization to myText.
var myFormat:TextFormat = new TextFormat();

[Code]....
 
The last statement is the one with the trouble

View 1 Replies

ActionScript 3.0 :: New Date().getTime() Is Returning A Negative Number?

Aug 12, 2011

f I trace new Date().toUTCString() I get something like: Fri Aug 12 07:14:06 2011 UTC.perfect. If I trace new Date().getTime() I get some long negative number which is decreasing as I continue to trace it. This is totally unexpected.

View 10 Replies

Actionscript 3 :: Generate Random Positive / Negative Number?

Feb 7, 2011

How do you generate a Number that is randomly postive or negative?

View 3 Replies

ActionScript 2.0 :: Negative To Positive Random Number Range?

Aug 29, 2006

How would one produce a random number, ranged from say, -100 to 100?

View 3 Replies

Actionscript 3 :: Turn Negative Number To Positive With Bitwise Operations?

Jul 16, 2011

Is there a direct way how to turn a negative number to positive using bitwise operations in Actionscript 3? I just think I've read somewhere that it is possible and faster than using Math.abs() or multiplying by -1. Or am I wrong and it was a dream after day long learning about bytes and bitwise operations?

What I saw was that bitwise NOT almost does the trick:

// outputs: 449
trace( ~(-450) );

If anyone find this question and is interested - in 5 million iterations ~(x) + 1 is 50% faster than Math.abs(x).

View 4 Replies

Flex :: Change Style For Positive And Negative Values?

Jul 6, 2009

Is there a way to change the style of Flex Chart according to the values.For example, in column chart, set green for positive value and red for negative value?

View 1 Replies

ActionScript 3.0 :: Change The Depth Of An Object?

Nov 9, 2010

I have been trying to change the depth of an object. I have only just started learning AS3, so I haven't looked into this yet.So far I have been using a trial-&-error method to try to get this piece of code to work which I found on a site, but I have not succeeded:

Code:

setChildIndex(example,numChildren-1);

I am putting this code in it's class, and I tried replacing the word example with 'this'. Can someone please help me? When I test the swf it comes up with this in output:

Code:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/setChildIndex()
at Foreground/enterFrame()

View 10 Replies

ActionScript 3.0 :: Change Depth Of MovieClip?

Jul 13, 2011

Im trying to change the depth or index of a movieclip when its click. And bring it to the top of everything. The problem is that the movie clip is not added by addChild, but nested in a frame.
 
so if i try and use any of these:

anyMC.parent.setChildIndex(anyMC, anyMC.parent.numChildren-1);
or public function bringMCToFront($mc:MovieClip){    $mc.parent.setChildIndex($mc, $mc.parent.numChildren-1);}
 
by it gives me this error: Error #1065: Variable setChildIndex is not defined.

View 6 Replies

ActionScript 3.0 :: Change Depth Of Movieclips?

Mar 14, 2012

i want when user rollover on any movieclip it comes on top after rollout it goes it's original position but, this code is showing error.ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
 
 private function pan3D():void{
excelmc=thumbswork.excel
officemc=thumbswork.office
googlemc=thumbswork.google

[code]....

View 1 Replies

Flex :: Change Depth When Using AddChild?

Jun 9, 2010

I'm adding a bg to the same canvas, but it's overlapping everything added before it.

View 2 Replies

ActionScript 2.0 :: Change The Depth Of Movieclip?

Apr 20, 2010

the question is a bit more involed. I have a dynamic text box, which I've put inside a movieclip. I hae a number of movieclips that I bring in using attachMovie, but my movieclip which contains my text box is underneath all the other movieclips.

I would like to know how I can tell my movie to display above all the other?

View 2 Replies

ActionScript 3.0 :: Change Depth Of A Specfic Mc?

Oct 6, 2009

right now I have some balls being generated like addChildAt(ball, 0);However what if I wanted to change the order of one specific ball?So make one ball 2 and add a alpha layer inbetween so the other balls cant be clicked.

View 14 Replies

ActionScript 3.0 :: Change Depth Of Movieclip With It?

Feb 8, 2011

If i wanted to change the depth of a movieclip using AS3

View 2 Replies

ActionScript 2.0 :: Change Depth On Drag And Drop?

Apr 22, 2011

Obasically I have the codes I need to make my project work but the problem is when I put my drag and drop code with my swap depth on hittest code my drag code stops working heeres the codes:

code for swap depth on a hit test:

Actionscript Code:
newDepth = 2;Object.swapDepths(newDepth);

Code for drag and drop:

Actionscript Code:
object.onPress = function(){object.startDrag();}object.onRelease = function(){object.stopDrag();}

View 4 Replies

ActionScript 1/2 :: Change The Layer Depth Of A Drawing?

Aug 22, 2009

I've got a spiral

-----------------
function spiral(centerX, centerY, radius, sides, coils, rotation){    with(this){        moveTo(centerX, centerY);        var awayStep = radius/sides;        var aroundStep = coils/sides;// 0 to 1 based.        var aroundRadians = aroundStep * 2 * Math.PI;        rotation *= 2 * Math.PI;        for(var i=1; i<=sides; i++){            var away = i * awayStep;            var around = i *

[code]....
 
and I want some movie clips to appear infront as well as behind it, but right now it always appears on the bottom layer. Is there a way to attach the drawing to a movie clip or something so I can change it's depth?

View 4 Replies

Actionscript 3.0 :: Change Cube Depth At Runtime?

Apr 15, 2009

I have a cube with depth = 0 that acts as a double sided plane.[code]...

We can't use depth as a property of the cube, so how can I change the depth of the cube?

View 1 Replies

ActionScript 2.0 :: Change The Depth Of MCs That Are Already Positioned On The Stage

Nov 16, 2004

I am trying to change the depth of MCs that are already positioned on the stage. However, there doesn't seem to be a property such as _depth. So can I even change the depth of an MC during the game and if so how would I do it?

View 3 Replies

ActionScript 2.0 :: Change Depth Of A Text Field?

Mar 7, 2005

How can I do so the textfield will be OVER the movieclip I just created with: createEmptyMovieClip("Line",1);

View 2 Replies

ActionScript 2.0 :: Change The Depth Of Multiple Symbols?

Nov 13, 2006

this is a simple one. on Frame XX i want to have symbols on layers 1,2,3 (for sake of argument) at differnt depths. thats the tag to change the depth of multiple symbols?

View 7 Replies

ActionScript 2.0 :: Change The Depth Of The Movie Clip?

Sep 3, 2007

I know when you assign an empty movieclip or a movieclip to the stage via actionscirpt you have to set a z depth on the layer.

Is it possible to change the depth of the movie clip? If so how?

View 1 Replies

ActionScript 3.0 :: Change MovieClip Depth On Drag?

Mar 10, 2009

Is there a way to change the depth (index number) of a movieClip when I click on it to drag. Example:Say I have three circles. Each circle has a MOUSE_UP and MOUSE_DOWN eventListener. When one is clicked It will bring it to the front so when I drag it will be above the two other circles.

View 7 Replies

ActionScript 3.0 :: Flash - Change The Depth Of A Textfield?

Jan 27, 2011

Im having a dynamic textfield in on the main timeline which loads an external text file. Im also using addChild on the main timeline to display a mc. The problem is that the textfield is always behind the mc!! how can i change the depth of the textfield?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved