Hi list...

I am creating a bunch of MCs on the stage that should each get an
onEnterFrame function defined, but only the first one created in the
loop is getting that function, and I don't see why.  Any ideas?

Thanks,
- Michael M.

        private function mLanguages(attachToWhat):Void {
                attachToWhat.attachMovie("languages", "langTest", 10,
{_x:50, _y:50});
                var totalFrames =
_root.theContent.langTest._totalframes;
                _root.theContent.langTest.removeMovieClip();
                for (var i:Number = 1; i <= totalFrames; i++) {
                        var hitherYon:Number = Math.round(Math.random()
* (150 - 60) + 60);
                        var riseSpeed:Number = ((0.03 * hitherYon) -
1.5);
                        var newClip:MovieClip =
_root.theContent.attachMovie("languages", String("lang" + i), (i + 5),
{_x:50, _y:50});
                        newClip.gotoAndStop(i);
                        newClip.onEnterFrame = function():Void {
                                newClip._y -= riseSpeed;
                        };
                }
        }

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to