flash actionscript:
Ok, I'm having the damnedest time with dynamic text fields..
In fact, I'm building an application, and I'm having odd to downright
wacky results.
I've create a complete fla/swf example for those of you that want to
investigate.
In my example, I have two MovieClips side by side, with two buttons that
control a transparent toggle of the above MovieClips.. Each MovieClip
has text inside it. Each MovieClip is exactly identical to the other
with one small exception.. One has Static Text, the other.. Dynamic Text.
When you click on the corresponding button, it changes the transparency
of the MovieClip above it. But, you'll notice that the one with Static
Text goes completely transparent (parent MC and text in it), and the one
with Dynamic Text the parent MC goes transparent, but the text never
changes?? Even though it's clearly inside the MC whose properties are
being changed.
If anyone understands this odd behavior, can you please explain it to me?
// sample code to illustrate the problems
// stop the movie
stop();
// set the button alpha(normal)
_root.button1._alpha = 80;
_root.button2._alpha = 80;
// set the tranprentcy flags
_root.screenExample1.transparent = false;
_root.screenExample2.transparent = false;
// first button
_root.button1.onRollOver = function() {
this._alpha = 100;
};
_root.button1.onRollOut = function() {
this._alpha = 80;
};
_root.button1.onRelease = function() {
if (_root.screenExample1.transparent == false) {
_root.screenExample1._alpha = 5;
_root.screenExample1.transparent = true
} else {
_root.screenExample1._alpha = 100;
_root.screenExample1.transparent = false
}
};
// second button
_root.button2.onRollOver = function() {
this._alpha = 100;
};
_root.button2.onRollOut = function() {
this._alpha = 80;
};
_root.button2.onRelease = function() {
if (_root.screenExample2.transparent == false) {
_root.screenExample2._alpha = 5;
_root.screenExample2.transparent = true
} else {
_root.screenExample2._alpha = 100;
_root.screenExample2.transparent = false
}
};
// end
Flash example:
http://www.deepmagicstudios.com/flash_problem/ fla download:
http://www.deepmagicstudios.com/flash_problem/text_Problem.fla Thanks
-Richard