开发者

Generated Flash effect appearing over-top of top layers objects

I have create the "snow" effect with the linked tutorial, basically it manipulates the instance of an object on the canvas and calls the script in the actions on the animation load.

However, I cant get the generated snow to show behind any other objects on the canvas.

http://www.kirupa.com/develo开发者_运维技巧per/mx/snow.htm

Generated Flash effect appearing over-top of top layers objects

You can see from the image the RedBox and the Border layers are above the SnowFlakes layer, I want them in front. How can I do that?


Flash's DisplayList operates as an array with no empty values. If you have 10 different display objects on the display list, each will populate index position 0-9. 0 will occupy the lowest layer, on up to 9, which will appear to float over everything else.

So, to get your SnowFlakes layer under everything else, you need to make sure it is at index 0, or at least below everything else, in this case your redbox and border.

How are the "snowfake" objects added into the display list? Make sure that flakes are being added to the correct displayobject:

var flake:SnowFlake = new SnowFlake();
SnowFlakeLayer.addChild(flake); 

and that that object is on the right layer

addChildAt(SnowFlakeLayer,0);

I didn't look at the tutorial, and you didn't post any code, but I would guess that you are not adding the flakes to the SnowFlakeLayer correctly. Assuming everything else is layered correctly, that is your problem.


In actionscript 2.0 you could look into the depth code for movieClips, the only one I know off the top of my head is movieClip.swapDepth(mc2); You could make mc2 the highest (most on top) movie clip in your whole animation.. but I'm sure with google you will find some depth code for actionscript 2.0 where you can put it ontop without swapping it's depth with something else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜