ActionScript 3.0 :: Changing The Rendering Order?
Jun 25, 2009
Imagine I had the movieclip structure below... root - mc1 mc2 - mc3 mc4 - mc5 - ... - mc6 mc 7Where my root has two children (mc1 and mc2), mc2 has two children (mc3 and mc4), etc... So taking mc6, it is a movieclip an arbitrary number of levels down the movieclip hierarchy.
I want mc6 to render as though it were a child of mc1, ie. before mc2 and its children. However, if I simply use addChild(), I would remove mc6 from it's current position in the hierachy, thus changing the transformations which determine it's position on the screen. I simply want to change the point in the order at which it is rendered to the screen (render it before all other clips), but NOT change where it is in the spatial hierarchy (in order to preserve animations etc).
My current way of doing this, is to set mc6 to visible=false. Then I add a bitmap to mc1. Then each frame, I wipe the bitmap and render mc6 to the bitmap using its localToGlobal transformation. However, this is a very wasteful solution since the bitmap needs to be the size of the screen which results in the entire screen being redrawn every single frame. I'd like to retain flash's built in optimizations for only redrawing changed movieclips.
Another way would be to duplicate the mc6 movieclip, and attach the duplicate to mc1 as a child whilst making the original clip invisible again. However, then I would have to update the new movieclip with every single possible change which could occur to the original mc6 - this would get complicated pretty quickly.
View 2 Replies
Similar Posts:
Apr 14, 2010
I have a component that has a sub-component they both use a shared variable from the model. The shared variable needs to be set by the parent component before it can be used by the child component. I did like this in the parent component:
<mx:Canvas
xmlns:mx="library://ns.adobe.com/flex/mx"
...
creationComplete="group1_completeHandler(event)" >
[Code]....
But for some reason when the code inside myCustomComponent tries to use myVariable for the first time I get a "null" object error. This means I guess that the child component gets rendered before the group1_activateHandler gets called and consequently myVariable gets set.
What should I do to ensure that the parent container initializes the variable before the child component gets created?
View 2 Replies
Nov 21, 2010
I have some movieclips on my stage that are there via timeline. I also add movieclips on stage using addChild.
What is the best way of changing the order of the movieclips because they overlap sometimes? eg.
mc_a is on the stage already
mc_b is called on stage using addChild
Can I change the order of mc_a using script even though it was already on stage?
Can I remove mc_a off stage using script?
How do add mc_b under mc_a so that mc_b does not overlap mc_a?
View 2 Replies
Nov 8, 2011
I have been shown how to do a very specific task in Flash Pro CS5. I have five slides in my timeline, with buttons that include links to product pages on our website. These five slides comprise a movie, with each slide being displayed for a few seconds and it repeatedly cycles through the five slides in a banner at the top of our home page. In addition there is a navigation bar below my slide images with a play and pause option, plus the five slide numbers so the viewer can navigate from slide to slide manually. I have been asked to change the order of the slides so that slide #5 now becomes slide #1 and slide #1 becomes slide #2, and so on.
I can easily switch the images and links so that the slides are in a different order in my file, but now the navigation bar below does not work. In the Actions panel, the #1 button in the navigation bar still appears to be linked to slide 1, which now has the new images, yet the nav bar does not respond to clicks anymore. How was my nav bar disabled when I switched the images and links around between the slides? and how can I correct this? I know nothing else about Flash except how to replace the images and change the button links in each slide, which I do monthly, as this is the top banner on our website.
View 2 Replies
Jan 25, 2006
I've been following the Changing Stacking Order (swapDepth) tutorial but there's something I'd like to know.In this tutorial, we have 3 buttons inside 3 Mc's. Each Mc is called green, yellow and blue.The AS code for each button is:
Code:
on (press, release, dragOver, dragOut) {
x = 0;
x = x+2;[code]....
What I would like to get is that the MC (window) that I click, goes to the top, BUT respecting the relative position for the others. I mean, in this tutorial, if you run the swf file and put every window a bit one over the other, and click the bottom window, it will come to the top, but the other two won't keep their relative position because the clicked window will be swapped with the one on the top. Understand? (it's very simple although difficult to explain).To make it easier: let's imagine we have 3 papers on the table and I pick up the one in the bottom and put it on top....this is exactly what I want (but in this tutorial, the other 2 papers are moved aswell). I just want that the window I click gets on top of the other 2, nothing else.
According to Kirupa's words, this EXAMPLE here is done using swapdepth aswell, and IT'S EXACTLY the behaviour that I want. Just compare this one with the one in the tutorial and see the different window behaviour.The thing is that I don't know how to do this with "swapdepths". In the AS reference bok it says it can be done but (as usual) they don't tell you how to do it...
View 8 Replies
Sep 6, 2003
is there any way to switch the stacking order of layers during a movie clip. ctually i want to do it with an on(release) action.
View 4 Replies
Jul 30, 2010
I have a movie on stage that acts as a button using the code. person_mc.buttonMode = true;
I load an image onto the stage from my library using addChild(holiday);
What happens is that the person_mc button I have on stage will not function anymore, because I am presuming it is underneath the holiday pic when I loaded it using addChild.
How do I load the holiday pic, so that it is underneath the person_mc?
I know I could do what I did with holiday using addChild for the person_mc, but I do not want to do it that way.
View 3 Replies
Mar 27, 2005
How do you change the TAB order of text input boxes. I want to tell it what box to go to next depending on which one it is on now making a login form ..
View 2 Replies
Dec 21, 2004
I have an FLA with a section in it where I need to swap between images (one over the other and so on, which I have done using swap depth) what I want to know is if there is a way to make the transition from one pic to the other smoother by using alpha from 100% to zero, thus revealing the picture beneath.
View 3 Replies
Jul 22, 2009
I've recently had the need to use the managers compiler argument, because the project had an Open Type font embedded, and was generating errors at compilation. Now I need to use the same argument in my ant task, but for some reason it doesn't work. I'm using Flex SDK 3.2.
The task looks something like:
<mxmlc
file="${main.class}"
output="${swf.export}"
actionscript-file-encoding="${ENCODING}"
keep-generated-actionscript="false"
[Code] .....
I've tried different variations, from using manager as a child element of mxmlc, to using it as an attribute, and combining it with prefixes (fonts, compiler.fonts). I've also tried to use it as sub-element of the element fonts, but nothing worked. I've considered using a shell task instead, but I'd rather not. For now I've changed flex-config.xml in the frameworks directory of the sdk, and it seems to do the trick, but I'm thinking there's got to be a way to do this in the task. Any exact elements I need to add to the task to make it work, without having to modify "flex-config.xml"?
View 1 Replies
Dec 27, 2002
I know, there is a tutorial about changing stacking order [URL], but the makers were so kind to use Mx files for the .fla's.
[Code]...
When I click one of the 4 buttons, the image related to that button has to move to the hightest position. And ofcourse the previous highest one should be the one under the new highest image. Well, I tried to fix the script, but for some reason it gets all confused and starts switching images, and sometimes none.
View 14 Replies
Aug 17, 2004
I am creating an order form for my flash site. I have never done this before in flash but I have in visual basic. I have a few questions:
1. Is assigning variable names to checkboxes and radio buttons the same as in visual basic? I mean i know that you probably assign them in the properties. ex..say i name a radio button 'radio1', to run a check in my actionscript whether radio1 was checked or not would it be something like if(radio1){}
2. After the person fills out the form I would like to have the results of the order sent to a pre-specified email adress in a certain format. What would be a good way to do this?
View 3 Replies
Jun 15, 2010
sorting number Ascending Order and Descending Order tutorial with out useing sort property[Array sorting like 91,3,5,4,6,8,3,6,1,0]
View 6 Replies
Jun 16, 2010
[code]how to do Ascending Order and Descending Order this array merge(don't use sort property)
View 1 Replies
Mar 20, 2009
I have an array, and I add info dynamically into it. I need some way to re-order the array into ascending order.
Another thing. How can I add a value in the first position of the array pulling keeping all the other values jumping to the next position.
View 2 Replies
Aug 14, 2009
How do I change the corner radius of a Label component in Flex. Tried applying style name, and the setStyle('cornerRadius',9) methods, but doesn't work. How can I change the arrow image in the combo box control to a different image?
View 4 Replies
Aug 31, 2009
I want to create another button on the main menu of my flash site. I want to take one of the existing buttons (which are set as movie clips) and modify it to show a different menu name and page link. BUT when I go into my library and "duplicate" my movie clip, change the instance name, drag it to the stage and attempt to modify it, the original changes as well. I need to keep the original the same and create a new one with the same code, frames, etc but with different static text. I keep going in circles
View 1 Replies
Feb 1, 2006
basically when you load the .swf it changed everytime u re-load it , i want it to keep on changing even when the user hasnt reloaded the image
[Code]...
View 1 Replies
Dec 9, 2011
I have to animate a bunch of text flags on a timeline, which my artist layed out in Illustrator. I import them from AI and if I am zoomed in they look fine, the verticals of the text are straight up and down. But if I zoom out, the verticals rotate to the slant.
Same goes for when I publish the swf. I have the flags all scaled small on the screen, and the text is all messed up. Then I scale up each flag to focus on it, and somewhere in the scale Flash decides my text is now big enough to look the way I want it. It is erksome. Is there a way I can force it to render straight up and down, without having to break everything and un-editablize my text?
View 1 Replies
Aug 5, 2009
I scripted a DropShadowFilter to render on my Movie Clip. The MC just consists of static text and its using the Tween class to move on the screen. Can't figure out why its not showing up. I'm using the same method on another movie clip that is just images, and works fine. Not generating any errors either.
Code:
import flash.filters.*;
var tds:DropShadowFilter = new DropShadowFilter(3,90,0x000000,40,3,3,1,3,false,false,false);
[code]....
View 4 Replies
Jan 6, 2010
I used FalshDevelop to compile PanoSalado opensource ".as" files to produce corresponding ".swf" files.it works great and my movie shows.However, when I run it via a webapp under Tomcat, it just sits there. The url is:Note that I'm running the same file (.swf) from the same place in the filesystem.And I even tried to embed the swf in an html page (actually a jsp page) to see if it would work.. but no dice... same issue.FWIW the html that is used to invoke the swf is :
<div id="flashbanner">this will be replaced by the SWF.</div>
<script type="text/javascript"> alert('0'); var so = new SWFObject('maps/ModuleLoader.swf','mpl','555','416','9', '#336699'); alert('1');
[code].......
View 1 Replies
Jul 20, 2011
I'm trying to create a video background for a game using the FLVPlayback component. I need to smoothly trasisition between multiple videos so I make a FLVPlayer for each one so that I can just tween the alpha when I need to show it. When I start the game I load everything and store the Playback components in a Vector, I think add them to the stage like this
for(var i:int = m_Videos.length-1; i > 0; --i)
{
addChildAt(m_Videos[i], 0);
}
Once the game is loaded though the first video dosnt render at all, so I have a see thoough background. But once I transition to a video that is on top of it, the top video renders.
View 4 Replies
Oct 26, 2009
I am trying to find a way to render a Flash object, more specifically a Open Flash Chart, in the server, and save a screenshot of it to a temp file to embed it in on a PDF report.
I've found some solutions that use Javascript to generate a temp file in the browser, and then send it to the server (like here). However I need to generate reports automatically and send them as e-mail attachments, so I cannot render it using a browser.
View 1 Replies
Jan 18, 2011
I'm playing with Air and trying to get the PaperVision3D engine to display some 3D models.
But its really slow since Air seemingly does not support GPU acceleration. Any way to enable GPU rendering in air apps? browser apps can use "wmode=gpu" in the HTML settings...
View 1 Replies
Apr 14, 2011
The idea is to increment the height of the TextField (with font embedded) and see the difference when it becomes too big. When container.height is over 279 you can notice two things:
1. container starts to increase its width property.
2. The "pixelated" glitch is gone now. (the original ugly pixelation comes from rendering multiple TextFields on top of each other - you can check the for loop). It looks like the issue of one font covering the other is solved differently now.
My question is: what changes when the font becomes too big? is there any property of the TextField (besides the size of course) that I can check to catch the moment? (gridFitType, antiAliasType, thickness, sharpness do not change)[code]...
View 5 Replies
Mar 17, 2012
I'm working on better performance on mobile device with gpu rendering set to on. I use only bitmaps for animations, but I have some doubts:
1. If my content is poor bitmap (jpg or png file) should I cache its container as bitmap?
2. Shoud I use cacheAsBitmapMatrix for my bitmaps to have smoother animations or poor bitmaps are already optimized?
View 0 Replies
Feb 28, 2008
I have a flash file that loads dynamic text from a text file. When you press the space bar, it animates the text upward like movie credits. It works fine until I add more than 50 lines or so, at which point it delays showing the text until it's well into its scrolling.the kink here is that it only displays this error when it plays in fullscreen mode (which it is set to do by default, and what I need). if I escape out to window mode, it plays the text animation just fine.
View 1 Replies
Apr 26, 2011
rendering performance when scrolling some content. I have a large sprite with a lot of content that I need to scroll and the problem that I am encountering is that when scrolling this big sprite, the rendering of the Flash Player seems to slow down and the movement is choppy. I wrote a custom scrollbar class that simply updates the target sprite y or x properties on an enter frame event. The large sprite that I am scrolling mainly contains other sprites that have drawn shapes, loaded bitmaps and text fields.
Considering that I am simply moving the sprite, there are no other animations happening, nor other intensive processes at the same time, I do not think that it should be that resource intensive as to slow down the Flash Player that much. What can I do to improve the performance when scrolling the sprite? (Just to give a rough approximation, the sprite that I am scrolling contains around 20-30 sprites with drawn shapes, 2-5 loaded bitmaps, 5-10 text fields.)
View 3 Replies
Jul 2, 2009
I have a webpage containing 2 DIV containers hidden using CSS. The site has a Flash Movie embedded. I want to render the content of these hidden DIV containers from within the Flash movie.I'm using CS4?
HTML
<div id="sectionone">content</div>
<div id="sectiontwo">content</div>
CSS
hide sectionone div and sectiontwo div
FLASH
Display sectionone within flash movie when requested
View 2 Replies
Jan 18, 2010
I would like to ask the experts for help. In a flash movie I want three lines of text where I want line1 to appear with a preset motion, then line2 directly below line1 to appear with a preset motion, then line3 directly below line2 to appear with preset motion. I want to have the smallest possible fla file.
View 5 Replies