Actionscript 3 :: Managing Depth - Any Property / Function That Sets Z-index?
Jul 31, 2010
I have a 3D field with many MovieClips in it, and seems like the one last added is the one that overlaps others and not the one with highest z value. Is there any property/function that sets z-index? (sorting children by z value seems too much like a hack). A 3D engine that can place MovieClips will be helpful(but not one that requires custom drawing). I'm using Flash CS5 with ActionScript 3
View 2 Replies
Similar Posts:
Feb 4, 2012
I was wondering what's the best way to manage an images depth. Currently I have 2 layers. On the top layer I have a png image of a window. The inside of the window frame is transparent so you can see though it. On the bottom layer I have a png image of a background that you cannot see though. I used addChild(MyMovieClip); to put an image onto the stage. It is in front of the window. I used addChildAt(MyMovieClip, 0); and the image ended up behind the background. I used addChildAt(MyMovieClip, 1); and the image ended up in front of the window again.
[Code]..
View 1 Replies
Mar 3, 2012
i'm desperately trying to set my border container the highest z-index so it will always appear on top.
how can I know how many objects are in my flex stage, so i'll be able to set the bordercontainer the highest depth? what shell i write in the depth property in order the border container would always be on top? (it's important to mention that i created dynamic objects)
<s:BorderContainer includeIn="state2" width="200" height="200" backgroundColor="#992F2F"
horizontalCenter="-61" verticalCenter="23" depth.state2=currentState.num>
</s:BorderContainer>
View 1 Replies
Mar 24, 2010
Here is the problem I have: after I change the index of one movieclip using this code
oldIndex=getChildIndex(DisplayObject(e.target));
setChildIndex(DisplayObject(e.target), numChildren - 1);
when I give the object its old index
setChildIndex(DisplayObject(e.target), oldIndex);
and go to another frame of the movie, this element I have changed the index of stays on top of all elements on the new frame. My question is am I doing something wrong and if not, what can I do so that this element stays only in the frame it is placed.
View 1 Replies
Jun 24, 2011
I'm trying to layer lots of objects behind each other depending on there y position.
each clip is added dynamically and assigned a numer as its name, then im trying to use the set child index to set its depth...
Code:
var number:Number = Number(movie.name);
setChildIndex(movie, number);
I get the error "The supplied index is out of bounds.", what does this mean
View 6 Replies
Jun 26, 2011
why changing the index or depth of the movieClip breaks the the timeline animation of this movieClip !!
View 7 Replies
Feb 21, 2006
I'm trying to delay a function which then sets the onEnterFrame of a clip The colde I am trying will not work
[code]...
View 2 Replies
Dec 23, 2009
I'm in a situation where I have a xml document which is going to be updated in the following way: The deepest child within the document which surrounds a certain x,y position (depending on it's x, y, width and height attributes) is going to get a new child element. If multiple childs exist with the same depth, the bottom one is updated.
My first step was to find this deepest child, this already caused problems, but I managed to solve this with the following recursion[code]...
View 2 Replies
Jul 26, 2011
I have used the index of a value object to map to a screen object so that new items added index as -1, -2, -3, -4, -5 etc. Now that I am ready to add these new objects to the database I want to clear their index value so that I can run a createService on them.
It wont allow me to delete object.property and setting it to 0 or trying to set it to null will not allow the object to be created in the database.
What other method can I use for clearing the property?
View 1 Replies
Mar 13, 2009
I'm pretty new to AS3 and am getting my feet wet as fast as I can. Currently I have a fairly simple thing I'm trying wherein I will have a button_mc that on ROLL_OVER, it triggers a function that will make another MC move. That part I can do- my question though is how can I have multiple button/movieclip "sets" that are able to call the same function? As an example, I'd have "button1_mc" trigger "shape1_mc", "button2_mc" trigger "shape2_mc", and so on. I want to avoid having to have separate sets of functions for each button/movieclip pair. I hope that makes sense.
Here's where I'm currently at with the first eventListener and corresponding function. You can see how in the function I have a specific MC (shape1_mc) named, which of course I'm trying to avoid, as I will likely have 5-10 similar buton/mc pairs like below. Is there a way to call the movieclip (shape1_mc) in the event handler itself without having to name it in the function?
[Code]...
View 3 Replies
May 30, 2007
im having some trouble when trying to implement the swap depth function to movieclips that have the setmask function implimented to them. the problem is that i can get the swapdepth to work but when the setmask is implimented at the same time the movie clips will not swap depths.
the code that i am using to set the mask is _root.bgmasked.setMask(_root.dragger); this is on frame one in the action/code layer bgmasked is the imaged being masked by dragger.
[Code]...
View 2 Replies
Feb 29, 2004
I need a function to find the lowest available depth for use in attach movies and such. And I also wanted to ask if running a function like this a lot would be too intensive to be practical.
View 3 Replies
Jul 28, 2010
I need the enemies to move around the obstacles on screen. I have tried several methods but it seems to screw up other functions in my game... For example the depth sorting function starts messing up (sortchildren()). I think its because i'm such an amateur.
View 8 Replies
Aug 11, 2010
I've defined an array which stores the function name, like this:
var aresetButtonTop:Array = new Array(resetTop1,resetTop2,resetTop3,resetTop4,resetTop5);
Then I have a button named"btnresetTop" which when clicked will call one of the five functions stored in the above array(aresetButtonTop). The functions are called at run-time depending upon some conditions. I need to figure out how I can call those functions using the array index. I'm using the following code to call the function. The value of i has been already calculated.
btnresetTop.addEventListener(MouseEvent.CLICK, aresetButtonTop[i]);
After doing this I'm getting the following error when I click the button:
TypeError: Error #2007: Parameter listener must be non-null. at flash.events::EventDispatcher/addEventListener() at gallerytest_fla::MainTimeline/thumbTopClick()
Note: thumbTopClick() is a function inside which all these codes are written.
I need to find out whether it is posible in AS3 to call a function name using the array index or not.
View 2 Replies
Jun 13, 2011
//*//*//*//*//**//**/**//**//**//**//**//**//**//**//**//**//**//
var t:Array=new Array();t=[d1,d2,d3,d4,d5];
var d:Array=new Array();d=[t1,t2,t3,t4,t5];
[code].....
View 6 Replies
Jul 6, 2010
I am trying to index a series of movie clips with their own unique index number for accessing through AS3. The example below is what I would like to achieve, when a user clicks on Topic1, I can trace back the index of 1, when a user clicks on Topic2, I can trace back an index of 6:
Topic1 (Index = 1)
|
|-subtopic1 (Index = 2)
[code].....
View 1 Replies
Aug 25, 2005
i can load xml, get what i want out of the nodes, attach mc's accordingly, etc. but i'm having trouble figuring out the best way to build a function for a button inside each dynamic mc that works correctly.I can build the function (which should load the corresponding variable's value for the array's position) but when the button is clicked it actually loads the variable associated with one array index position up.so if i'm clicking on the button that's supposed to load [0], I get the value for [1]'s variable. make sense?ode:
Code:
stop();
holderMc._visible=false;
[code]......
View 3 Replies
May 11, 2004
putting a movieclip into highest depth without knowing which clip is in the highest depth
View 2 Replies
Jun 22, 2011
So, for sending to individual streams we have to reference the connected netStream we want to send to in some way like this:
sendStream.peerStreams[0].send("MyFunction",param1,param2);
and I have to determine which peer I'm sending to by their ID such as "peerID1234"
I know that you can check the peerID of the stream by doing:
sendStream.peerStreams[0]["farID"]
how can I make my send stream function know to use the array index where the peerID is?
so basically it could be like:
sendStream.peerStreams[where peerStreams[]["farID"] == peerID].send("MyFunction",param1,param2);
View 1 Replies
Jun 3, 2010
I've created an AS class to use as a data model, shown here:
package
{
import mx.controls.Alert;
[code].....
View 5 Replies
May 22, 2007
however I need to create a gallery with two rows of thumbnails representing Before & After situation. So the xml would have to make a reference to 2 sets of images/thumbnails. I don't even have to have them scrolling. Is there an easy way of modyfying the existing code?
View 2 Replies
Aug 18, 2011
I am trying to scale a swf that has been loaded via a swfloader. When I get the complete event or the init event the dimensions of the swfloader are still zero. I don't see a value in the dimensions until I do a resize of the browser window. The swf is just an animation. Trying to resize the actual swf content gives inconsistent results.
View 1 Replies
Feb 20, 2007
I have a project to do and I'm not sure how to get it done. I have some experience using xml to load images into flash but that was one at a time. the project that i'm currently working on needs to work like something like this.
I need flash to load in three images at one time(from an xml file) and display them in a horizontal line, and then move across the stage from one side to the other.
i know how to load one image at a time but not multiple. and i don't know how to make the images slide across the stage in a line.
View 4 Replies
Jul 22, 2009
If I import a font to the library, am I correct in assuming that it imports the massive character set (all). There seems to be no setting that I can see where to specify the glyphs or level of character support for example all the funny characters.
View 9 Replies
Aug 8, 2011
I have a working timer in a class file that calls animations over a 15 minute period.
ActionScript Code:
public class rockSniperAlerts extends MovieClip
{
[code]......
View 2 Replies
Apr 21, 2005
I know how to display 1 record set from asp to flash but I get tuck when trying to display multiple record sets. Do i have to loop with action script? I really dont know. I am trying to make a news blog and pull news from the database into flash and organize it similar to this
[Code]...
View 4 Replies
Apr 21, 2005
I know how to display 1 record set from asp to flash but I get tuck when trying to display multiple record sets. Do i have to loop with action script? I really dont know. I am trying to make a news blog and pull news from the database into flash and organize it similar to this
Date -- Headline
Bla BLah BLah Blah
Posted by: Webmaster
[code]...
View 4 Replies
Mar 4, 2009
The searches that I did on this topic aren't providing me with any answers...that I can understand anyway. =*) Here's the situation.In the past, I did computer-based-training using "a different authoring tool." One thing I discovered I could do with that tool--which really opened up new possibilities for me--was to use that scripting language to create a snapshot of the current window and save that image as an object/class. Then I could access that object, resize it, save it to disk, and load it in later. The result--for my training at least--was a visual bookmark of their location in the training should they have to save and come back later.I would now like to do this with Flash.specificially CS4 and AS3.If anyone can point me in the right location to get started,For clarity, the steps are:
1: Take a snapshot of the current Flash window / Stage. I'm not concerned if the snapshot remains "in Flash" or goes to the Clipboard as long as I can get to it in the next step.
2: Access that snapshot from where-ever it's stored.
3: Process the snapshot and reduce it to a thumbnail, etc.
4: Save it to a file that I can bring back into the .swf at a later point. I'm not real concerned about the format of the file as long as I can bring it back in later. How do I save it? I would love to be able to save it to the user's machine but last I checked
Flash won't do that sort of thing. Can I save it as a file on the server that the .swf is running from using perhaps a PHP call /script / page?
5: And, of course, recall the image to be used at a later point. I already have a pretty good handle on this from past experiments.
View 1 Replies
May 31, 2010
I'm doing some newbie tests, so I decided to capture the keyboard events to move a rectangle. But I don't get the desired result. Unless I click on the TextArea box, I'm not able to capture the event key code. After that, all goes pretty well.
[Code]...
View 1 Replies
Jan 5, 2012
Does anyone know the name of the event that is dispatch by the attachCamera(), i would like to take a picture ones the camera is loaded, i try to execute my code after call attachCamera but it takes the VideoDisplay empty, that's why i would like to know if there is an event triggered after the attachcamera() is complete loeaded.
View 1 Replies