createEmptyMovieClip on bottom layer?

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default createEmptyMovieClip on bottom layer?

    I've got a fla with several layers containing my menu, header, content, etc. On the bottom layer I've got some code that creates an empty MC, loads a random jpg, and fades it in.

    The problem is that the jpg loads on top of everything else, even though it is on the bottom layer and I have the layer specified to 1.

    Heres the code with the problem:

    // Create empty MC and load random jpgs
    createEmptyMovieClip("bg", 1);
    bg._alpha = 0;
    bg.loadMovie("bgpicts/bg"+Math.ceil(Math.random()*9)+".jpg", "bg", 1);

    And heres the rest of the code if you want to know:

    // Checks to see if image is loaded and tells flash its there
    this.onEnterFrame = function() {
    BLoaded = bg.getBytesLoaded();
    BTotal = bg.getBytesTotal();
    percent = BLoaded/BTotal*100;
    //Transforms jpg
    if ((BLoaded == BTotal) && BLoaded>0) {
    bg._xscale = 100;
    bg._width = 750;
    bg._height = 500;
    bg._x = 0;
    bg._y = 0;
    //alpha fade in
    this.onEnterFrame = function() {
    _root.bg._alpha += 10;
    if (_root.bg._alpha>=100) {
    delete this.onEnterFrame;
    }
    };
    }
    };



    Let me know if you want the fla

    Thanks for your help,

    Gabe



    gabetiller webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. createEmptyMovieClip always below other layers?
      I'm using createEmptyMovieClip() to make, well, an empty MovieClip, in which I then draw a TextField using createTextField(). The trouble is, even...
    2. Bottom layer spoils its upprt layer
      In my bottom layer, I have a gradient fill in gray color. On top of this layer, I have some paragraphs in blue color. I want the bottom layer has no...
    3. Bottom layer spoils its upper layer
      In my bottom layer, I have a gradient fill in gray color. On top of this layer, I have some paragraphs in blue color. I want the bottom layer has no...
    4. How to position a "footer" layer at the bottom of each page
      I'd like to have a small layer at the bottom of each page with our copyright and contact info, like a footer in Microsoft Word. I can't figure out...
  3. #2

    Default Re:createEmptyMovieClip on bottom layer?

    the layer containing your code is irrelevent. you bg is created at depth 1. as such it will appear above everything that you manually place on-stage because these objects usually have depth less than -16,000. to remedy, use swapDepths() to position your movieclip bg.


    kglad webforumsuser@macromedia.com Guest

  4. #3

    Default Re:createEmptyMovieClip on bottom layer?

    Thanks much, turns out I dont even need swapDepths(), I just needed to know that the other elements were way down there at -16000 and then I created the MC at -99999.

    // Create empty MC, send to bottom, and load random jpgs
    createEmptyMovieClip("bg", -99999);
    bg._alpha = 0;
    bg.loadMovie("bgpicts/bg"+Math.ceil(Math.random()*9)+".jpg", "bg", -99999);


    Anywho, thanks for your help,

    Gabe


    gabetiller webforumsuser@macromedia.com Guest

  5. #4

    Default Re:createEmptyMovieClip on bottom layer?

    you're welcome.


    kglad webforumsuser@macromedia.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139