Actionscript 3.0 :: Change Cube Depth At Runtime?
Apr 15, 2009I 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?
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?
change a cube's materialList at runtime in Papervision 3d?
I have a cube already drawn up with two different images on the front and back. When it's clicked, I want to change the image texture on the back and then spin it to show the recently loaded image's side. Spinning's fine, I'm just unsure how to change the cube's materialist.
im develloping an application for create a layout of advertising newspaper. the user can set the number of pages, and create rectangles represanting the adverts, then drag them and place them into the the representation of the page.the display list is as follow: on the main stage there is inputs textfields and a button that create the pages according to the number that the user typed.Then instances of the pages are created (MC Page in the lybrary exported for AS as Page and i have a class Page as well). Inside this clip Page i have my tools for create the rectangles and drag and place.....As well as the instances of my pages are created, button(1 for each Page) are also created. NOTE that Page and button are in the main stage My probleme is that i want my button to change the depth of is related page for it can be on top or alpha at 100% or the visibilty to true, but my button doesnt find the instance name of the pages at the export because they are not yet created.
View 9 RepliesI have a Cube, and I want to change it's width depending on it's container width...
ActionScript Code:
private var _sceneWidth:Number = 500;
override public function set width(value:Number):void
[code]....
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()
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.
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]....
I'm adding a bg to the same canvas, but it's overlapping everything added before it.
View 2 Repliesthe 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?
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 RepliesIf i wanted to change the depth of a movieclip using AS3
View 2 RepliesObasically 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();}
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?
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 RepliesHow can I do so the textfield will be OVER the movieclip I just created with: createEmptyMovieClip("Line",1);
View 2 Repliesthis 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 RepliesI 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?
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 RepliesI 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.
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 RepliesI 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 RepliesI've got a looping slideshow. I'd like to place a sliding menu at the bottom of the screen. The problem is I've created the slideshow dynamically, and the images being loaded all inherit a depth greater than 0.
how I can place the sliding menu at the very top of the presentation when it's already on the stage?
I'm looking to create a rotating set of images, simulated to look 3D... that can rotate either left or right, reactive to someones mouse location.
The path of the images would look like a flat oval, and as the images came to the forefront, they would be at full scale, have the lowest position (high _y), have the highest depth (appear in front of everything else) and be dead center _x.
As they slide left or right, they would reduce everything by a relative 50% to the final shift (scale, _y, and depth) until they got to the end, moving in an upward arc following the oval path. When they got to the end, and kept rotating beyond (move in the opposite _x. but appear to follow the flow of the arc), continuing to decrease in scale, _y, and depth.
why changing the index or depth of the movieClip breaks the the timeline animation of this movieClip !!
View 7 RepliesI was wondering if there is a way to change fps(Frames Per Second) during run time using AS3.is there? if so is it recommended? or is there a way to slow down the execution of the code(like adding a pause?)
View 5 RepliesIs possible to change fps in runtime ?
View 3 RepliesHow can we change the attribute name ows_Attachments to Attachments in runtime ??
ActionScript Code:
<rootNode>
<data>
<row ows_Attachments="0" ows_LinkTitle="1" ows_productNo="1" ows_purchaseDate="2010-06-09 00:00:00" xmlns="#RowsetSchema"/>
[code]....
I want to change by code, in as3 the color of the stage, I write: stage.color = "black" , but gives me error
View 1 RepliesI create a TLFTextField object at design time and need to change its direction at runtime, how this could be possible? the following code did not work and simply ignored: var myText:TLFTextField = MyText;myText.textFlow.direction = "rtl";
View 12 RepliesI want to change the image at click event.I change the source of the image on click but its not reflecting immediately it comes when any other event is fired.
View 2 Replies