Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
gabetiller webforumsuser@macromedia.com #1
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
-
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... -
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... -
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... -
on Director : 3D layer + flash (SWF) layer (or with other layer type)
Thankx for all it's works :) Coool -
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... -
kglad webforumsuser@macromedia.com #2
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
-
gabetiller webforumsuser@macromedia.com #3
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
-
kglad webforumsuser@macromedia.com #4
Re:createEmptyMovieClip on bottom layer?
you're welcome.
kglad webforumsuser@macromedia.com Guest



Reply With Quote

