Edit ActionScript to be behind other layers?

I used some ActionScript to create a snow effect for my flash animation. Right now, the snow falls in front of my other layers, and sending to back isn't working. I'll post the ActionScript below.
I have a treeline background, with snow falling on top of that. I have pieces of a logo flying in, and I want that to be OVER the snow. Currently, when I play the animation, all I can see is the treeline and snow, and I'm guessing the logo is flying together behind it.
Can anyone be kind enough to point out how I can get this done? Thanks so much.
Snowfall ActionScript that I used (not mine) :
var snowflakes:Array = new Array();
var snowflakeProps:Dictionary= new Dictionary(true);
var max_snowsize:Number = .04;
// pixels
var snowflakesCnt:Number = 900;
var oheight:Number;
var owidth:Number;
init();
function init():void {
          owidth = width;
          oheight = height;
          // quantity
          for (var i:int=0; i<snowflakesCnt; i++) {
                    var t:MovieClip = new SnowFlake();//
                    t.name = "snowflake"+i;
                    t.alpha = .2+Math.random()*.6;
                    t.x = -(owidth/2)+Math.random()*(1.5*owidth);
                    t.y = -(oheight/2)+Math.random()*(1.5*oheight);
                    t.scaleX = t.scaleY=.5+Math.random()*(max_snowsize*10);
                    var o:Object = new Object();
                    o.k = 1+Math.random()*2;
                    o.wind = -1.5+Math.random()*(1.4*3);
                    snowflakeProps[t] = o;
                    addChild(t);
                    snowflakes.push(t);
          addEventListener(Event.ENTER_FRAME, snowFlakeMover);
function shakeUp():void{
          for (var i:int=0; i<snowflakes.length; i++) {
                    var t:MovieClip = snowflakes[i] as MovieClip;
                    t.x = -(owidth/2)+Math.random()*(1.5*owidth);
                    t.y = -(oheight/2)+Math.random()*(1.5*oheight);
function snowFlakeMover(evt:Event):void {
          var dO:MovieClip;
          var o :Object;
          if(visible && parent.visible){
          for (var i:int = 0; i < snowflakes.length; i++) {
                    dO = snowflakes[i] as MovieClip;
                    o = snowflakeProps[dO];
                    dO.y += o.k;
                    dO.x += o.wind;
                    if (dO.y>oheight+10) {
                              dO.y = -20;
                    if (dO.x>owidth+20) {
                              dO.x = -(owidth/2)+Math.random()*(1.5*owidth);
                              dO.y = -20;
                    } else if (dO.x<-20) {
                              dO.x= -(owidth/2)+Math.random()*(1.5*owidth);
                              dO.y = -20;

My tree movieclip is named Bitmap2 and my logo movieclips (actually in 4 pieces that fly together) are Object1, Object2, Object3, and Object4.
I'm getting an 1120 error (undefined property).
Here's what I've got so far (and I apologize for any errors I'm making here, I'm a beginner) :
addChild(Bitmap2);
var snowflakes:Array = new Array();
var snowflakeProps:Dictionary= new Dictionary(true);
var max_snowsize:Number = .04;
// pixels
var snowflakesCnt:Number = 900;
var oheight:Number;
var owidth:Number;
init();
function init():void {
          owidth = width;
          oheight = height;
          // quantity
          for (var i:int=0; i<snowflakesCnt; i++) {
                    var t:MovieClip = new SnowFlake();//
                    t.name = "snowflake"+i;
                    t.alpha = .2+Math.random()*.6;
                    t.x = -(owidth/2)+Math.random()*(1.5*owidth);
                    t.y = -(oheight/2)+Math.random()*(1.5*oheight);
                    t.scaleX = t.scaleY=.5+Math.random()*(max_snowsize*10);
                    var o:Object = new Object();
                    o.k = 1+Math.random()*2;
                    o.wind = -1.5+Math.random()*(1.4*3);
                    snowflakeProps[t] = o;
                    addChild(t);
addChild(Object1);
addChild(Object2);
addChild(Object3);
addChild(Object4);
                    snowflakes.push(t);
          addEventListener(Event.ENTER_FRAME, snowFlakeMover);
function shakeUp():void{
          for (var i:int=0; i<snowflakes.length; i++) {
                    var t:MovieClip = snowflakes[i] as MovieClip;
                    t.x = -(owidth/2)+Math.random()*(1.5*owidth);
                    t.y = -(oheight/2)+Math.random()*(1.5*oheight);
function snowFlakeMover(evt:Event):void {
          var dO:MovieClip;
          var o :Object;
          if(visible && parent.visible){
          for (var i:int = 0; i < snowflakes.length; i++) {
                    dO = snowflakes[i] as MovieClip;
                    o = snowflakeProps[dO];
                    dO.y += o.k;
                    dO.x += o.wind;
                    if (dO.y>oheight+10) {
                              dO.y = -20;
                    if (dO.x>owidth+20) {
                              dO.x = -(owidth/2)+Math.random()*(1.5*owidth);
                              dO.y = -20;
                    } else if (dO.x<-20) {
                              dO.x= -(owidth/2)+Math.random()*(1.5*owidth);
                              dO.y = -20;
Thanks a million.

Similar Messages

  • How come the color of items in some MC can be edited whilst the colors of other MC can't

    How come the color of items in some MC can be edited whilst
    the colors of other MC can't. All layers are unlocked.

    Need more info - could be anything - maybe the object is a
    Drawing Object - or Grouped - or an
    instance of a symbol - or...?
    Chris Georgenes / mudbubble.com / keyframer.com / Adobe
    Community Expert
    nikos_golf wrote:
    > How come the color of items in some MC can be edited
    whilst the colors of other MC can't. All layers are unlocked.

  • Working window disappears behind other open windows at random times.

    The window I'm working on keeps popping back behind other open windows at random times (not related to the program I'm using). Is anyone else experiencing this after upgrading to Mavericks?

    This is what happens for one of the active corners for Exposé, if ("all windows") is the upper left corner. Take a look at "System preferences" , Dashboard & Exposé.
    Message was edited by: eddy kestemont

  • I am using Aperture 3 now and I love it. But I would like to purchase or download perhaps some freeware, easy to use photo imaging/editing software with more filters, perhaps layering etc. My Apple mentor suggests Pixelmator or Gimp ?

    I am using Aperture 3 now and I love it. But I would like to purchase or download perhaps some freeware, easy to use photo imaging/editing software with more filters, perhaps layering etc. I don't want something with a very steep learning curve, getting to old for that. My Apple mentor suggests Pixelmator or Gimp ? Are there some others out there? When I was still in the Windows world, I used Photoshop Elements but that is now in my past. Any ideas?

    Pixelmator or Gimp are both nice tools for advanced image processing and compositing. I.e. Gimp can do pretty much the same as Phtoshop. You might also have a look at digikam  http://www.digikam.org/drupal/download/binary
    Digikam is not just an advanced image processing and compositing program, it is also content management system like Aperture or iPhoto.
    I also find GraphicConverter a nice tool, but it is not free.
    If you want your image editing tools to integrate well with Aperture, I would look first at the available plug-ins, start with the plug-ins offered in the Aperture pull-down menu
    Aperture -> Aperture Plug-ins...

  • Cannot edit text or any command other than print in Adobe Acrobat 9.0.1 Pro. Receive error message

    I just installed adobe acrobat 9.0.1 Pro and it opens up pdfs and prints fine but when I try to edit text or enter any other command I get an error and it gives the option of cancel to debug or to exit program.
    Error message:
    The instruction at “0x2b806327” referenced memory at “0x00000348”. The memory could not be “read”.
    Click on ok to terminate the program
    Click on CANCEL to debug the program
    At first it stated that it did not recognize the font but when I looked it up under file, properties, fonts. The font was helvetica (embedded subset) for all the fonts on the pdf file. I have also checked the sercurity tab as well and there is no security on the file.
    When I choose cancel to debug it just terminates the program. When I choose ok it terminates the program.
    Please help.

    Maybe your installation is currupt (scratched CD)
         Reinstall on another maschine (and clean CD) to validate this case.
    Update your Acrobat, maybe the corresponding files are replaced or the error is fixed.

  • How to make a ramp affect other layers

    I'm trying to create a lower thirds that will include some motion, otherwise I might try Photoshop for this. But basically, I'm trying to create a gradient using ramp in AE so that the lower thrids I've created fades away on the sides. Similar to the image I've attached. I don't know how to make the layer that I put the ramp effect on affect the other layers. Can anyone help?

    Dave's method is great.
    Like all things AE, there are many ways to accomplish the same thing.
    Some alternatives are: Make a black & white gradient ramp on one layer, and use it for a track matte on another matte. You can also use the Set Matte effect to copy the alpha of one layer to another.
    There are direct ways to create alpha ramps using 3rd party plug-ins like Ramp Alpha that's in Red Giant's Key Correct and Image Lounge.

  • Unlocking Background Layer with lots of other layers

    I've been looking at the similar questions, but no script has worked perfectly yet. I have a series of phoshop actions that I run on a regular basis. I have two version of each, one for if there's a locked background layer, and one for when its already been unlocked. Otherwise my actions error.
    I'd like to simplify the process and have a script run that finds any locked layers (ie: background) and unlocks it, even if there are 15 other layers and even if I have another layer selected. It should also run without errors if there are no locked (background) layers to be found.
    I don't know the first thing about writing my own scripts, so can somebody tell me what lines of code I'd need? Thank you Thank you!

    function makeActiveByIndex( index, visible ){
        var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putIndex(charIDToTypeID( 'Lyr ' ), index )
        desc.putReference( charIDToTypeID( 'null' ), ref );
        desc.putBoolean( charIDToTypeID( 'MkVs' ), visible );
        executeAction( charIDToTypeID( 'slct' ), desc, DialogModes.NO );   
    function getNumberOfLayers(){
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID( 'Prpr' ), charIDToTypeID( 'NmbL' ) );
        ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID( 'Ordn' ), charIDToTypeID( 'Trgt' ) );
        return executeActionGet( ref ).getInteger( charIDToTypeID( 'NmbL' )) ;
    function getProperty( psClass, psKey, index ){// integer:Class, integer:key
        var ref = new ActionReference();
        if( psKey != undefined ) ref.putProperty( charIDToTypeID( "Prpr" ), psKey );
        if(index != undefined ){
            ref.putIndex( psClass, index );
        }else{
            ref.putEnumerated( psClass , charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
        try{
            var desc = executeActionGet(ref);
        }catch(e){ return; }// return on error
        if(desc.count == 0) return;// return undefined if property doesn't exists
        var dataType = desc.getType(psKey);
        switch(dataType){// not all types supported - returns undefined if not supported
            case DescValueType.INTEGERTYPE:
                return desc.getInteger(psKey);
                break;
            case DescValueType.ALIASTYPE:
                return desc.getPath(psKey);
                break;
            case DescValueType.BOOLEANTYPE:
                return desc.getBoolean(psKey);
                break;
            case DescValueType.BOOLEANTYPE:
                return desc.getBoolean(psKey);
                break;
            case DescValueType.UNITDOUBLE:
                return desc.getUnitDoubleValue(psKey);
                break;
            case DescValueType.STRINGTYPE:
                return desc.getString(psKey);
                break;
            case  DescValueType.OBJECTTYPE:
                return desc.getObjectValue(psKey);
                break;
            case  DescValueType.LISTTYPE:
                return desc.getList(psKey);
                break;
            case  DescValueType.ENUMERATEDTYPE:
                return desc.getEnumerationValue(psKey);
                break;
    var doc = app.activeDocument;
    var layerCount = getNumberOfLayers();
    var invisibleLayers = [];
    var loopStart = Number(!doc.layers[doc.layers.length-1].isBackgroundLayer);
    for(var layerIndex = loopStart;layerIndex<=layerCount;layerIndex++){
        if(!getProperty( charIDToTypeID('Lyr '), stringIDToTypeID( 'visible' ), layerIndex )) invisibleLayers.push(layerIndex);
    for(var hiddenIndex=0;hiddenIndex<invisibleLayers.length;hiddenIndex++){
        makeActiveByIndex( invisibleLayers[hiddenIndex], true);
        if(doc.activeLayer.allLocked) doc.activeLayer.allLocked = false;
        if(doc.activeLayer.pixelsLocked) doc.activeLayer.pixelsLocked = false;
        if(doc.activeLayer.positionLocked) doc.activeLayer.positionLocked = false;
        if(doc.activeLayer.transparentPixelsLocked) doc.activeLayer.transparentPixelsLocked = false;
        doc.activeLayer.visible =  false;

  • Photoshop 3d obj interacting strangely with other layers

    After Effects and Photoshop CS5.
    I have an imported photoshop 3d object which on its own behaves as it should.
    But, when I place it in front of other layers (2d in 3d space) I can see the other layers through the photoshop 3d layer. They are all behaving in space as they should, apart from the fact that the photoshop layer seems to be made of glass (which it isn't).
    I can't for the life of me work out what I am doing wrong.
    Apart from this, I can't get shadows to work in this comp, where in another comp which is exactly the same apart from the imported PS 3d object, they are working fine. (If I hide the PS 3d object, shadows and lighting work fine with the rest of the objects)
    Or is all of this impossible because I'm using a PS 3d object?
    I would be grateful for any ideas, because I am totally stumped.

    Well, you completely misunderstand how this works, I'm afraid. PS Live 3D is merely an intra-layer effect and does not in any way interact with AE's own 3D beyond responding to the camera. That's no differtent than using 3D-ish effects like Trapcode Particular - the effect may look 3D, but is applied to a 2D layer. And that also explains all your otehr issues - any form of 2D layer inbetween 3D layers breaks 3D rendering order. You need to re-structure your project by splicing the stuff to separate comps and cross-linking the cameras to get the illusion.
    Mylenium

  • Edit a page on an other computer

    Hello everybody,
    Can someone explain me, how I can watch and edit my page on an other computer?
    The directory "iWeb" (user/applications/iweb) doesn't exist on my mac ...
    I can publish my site under complete publish, then i get an dir with all the images and html files, but where is the whole project dir?
    thanks for your help!

    These articles may help:
    _iWeb: Modifying your site from another computer_
    iWeb: Publish to your MobileMe account from more than one computer
    Managing an iWeb site from multiple Macs with Dropbox
    Also see NOTE 1 here:
    http://iwebfaq.org/site/iWebTwocomputers.html

  • How to create a "dummy" layer to link other layers to the dummy.

    Here is my problem:
    I have a bunch of Layers, I want to behave the same way (here scaling, but I had also rotation before). My approach (as used formerly with my 3D applications) is to create a "dummy" layer, where the channnels of the other layers are linked to. For this I used the "Placeholder" item, but rendering obviously got me an error message, because the "placeholder" is intended for other use.
    So my question: How do you solve such a situation the intended way?
    L.

    Found the possible answer by sniffing on other peoples problems: The dummy is called "Null" here!
    Unfortunetly, I cannot offer to myself the 10 points!

  • Scripting: One layer to adjust opacity of other layers?

    Hi there,
    i've a lot of layers in my comp which names start with "POINTER_".
    I would need those layers to fade out at the same time.
    But i can't subcomp them or use stencil alpha.
    I'm sure it is possible to do a script on an adjustment layer that would do just that.
    All it needs to do is enable me to do opacity keyframes on that adjustment layer which are then linked to the opacity to all layers starting with "POINTER_".
    I'm not a scripting guy so it would be awesome if somebody could show me how to do that.
    Thanks a lot!
    cheers,
    Chris

    You don't need a script for it; you need an expression.
    You can very easily link properties between layers with expressions. In this case, you would apply an Expression Effect Slider to your null layer (or just use the opacity property of an adjustment layer). Then alt-click the opacity property for one of your layers and use the pick whip to choose the slider effect or the opacity property of your controlling layer. Now, when you change the value of the one layer, the others follow. You can copy and paste the expression that resulted from your pick whip to the other layers. (You can even choose to copy the expression only and then paste that to the rest of the layers.)

  • How to hide front panel objects behind other front panel objects

    Hi,
    I need tho change an existing project and to make it simple just want to hide some front panel objects behind others. But I can't find how to put the one I wnt to the front hiding all others. So now there are some in front that should be hidden.
    Is there a button or menu item "Move to front / back" like in many other programs?
    Thanks
    Martin
    Solved!
    Go to Solution.

    Hi Martin,
    what about the link I provided in my previous post? What else do you need?
    What about the chapter "fundamentals" in the LabVIEW help?
    Going the way "Fundamentals -> Building the FrontPanel -> How-To -> Reordering Objects" seems rather logically to me…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Layers, not lock but can't see other layers

    I was trying a new option I read in photoshop about changing brush size by using control & option to size instead of command; bracket no problem but how do I get back to com;bracer and also what did I do because now when I open up other layers ,like selections or new layer I'm only seeing the original layer not any of the others .I tried default that didn't work .
                                                                                            jack

    Are You talking about CS4?
    ctr-alt-dragging for resizing has not replaced the Shortcuts for Brush sizes, it’s an additional option – so whatever problems You are seeing are likely connected to something else.
    But quite frankly I don’t fully follow Your description … have You restarted the program yet?
    And if this didn’t help tried trashing prefs (by pressing shift-command-alt on starting the program)?

  • How do I subtract the shape of a layer (a scanned shape) from my other layers - but when the shape hasn't been drawn in photoshop

    Im trying to subtract a shape I have previously painted and scanned in from my other layers...can this be done?

    If this is the effect you want, add a white bottom layer, and create a mask of the heart art to drop it out of image layers
    or... do  you want color only in the heat shape and the rest of the page white?

  • Active Window Appears Behind other Windows on W2K8 R2 RDS Server

    We are using a W2K8 R2 server running RDS and Xenapp 6.5. While using IE 10 and selecting the print option which calls the Crystal Reports Print Control 14 download control for IE 10 the print setup window appears behind all other windows. I have some
    other applications that place the active window behind other windows. I tried the reg fix but that didn't work.

    Hi,
    Thank you for posting in Windows Server Forum.
    As you have commented the issue appears from single user, so try to delete the user profile cache and see whether it can resolves the issue. Also you can remove all the permission assigned to that users for a try.
    You can delete user roaming profile cache as follows. 
    To resolve this issue, add a REG_DWORD value named DeleteRoamingCache to the following registry key: 
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DeleteRoamingCache 
    Set the value data to 1.
    After this restart the system and try to login on system and also try to login faulted users on other system to check the result.
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    TechNet Community Support

Maybe you are looking for