This works:
 
 
var yPos:Number = 50; 
for (var i:Number = 0; i < 5; i++) { 
        duplicateMovieClip(templates, "templates" + i,
this.getNextHighestDepth()); 
        var mc:MovieClip = this["templates" + i]; 
        yPos += 50; 
        mc._y = yPos; 
        mc._alpha = 0; 
        fadeInTemplates(mc); 
} 
function fadeInTemplates(mc):Void { 
        mc.onEnterFrame = function() { 
                if (mc._alpha < 100) { 
                        mc._alpha += 5; 
                } else { 
                        delete mc.onEnterFrame; 
                        trace("delete mc = " + mc); 
                } 
        } 
}; 
 
 
HTH 

-Keith 
http://keithreinfeld.home.comcast.net
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of macromedia
flash
Sent: Tuesday, July 17, 2007 3:46 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] onEnterFrame() and delete onEnterFrame()

hi there,

I am workin on the the script below, and have problem for onEnterFrame()
action.

1. there is an movieclip on my stage and assigned the Instance Name to
"templates".
2. I would like to use duplicateMovieClip to create 5 more templates on the
stage and have fade in effects.
3. After that, delete the onEnterFrame() action.

However, the onEnterFrame() doesn't work, would you please help me to have a
look?

Best Regards


===========
var yPos:Number = 50;
for (var i:Number = 0; i<5; i++) {
 duplicateMovieClip("templates", "templates"+i, getNextHighestDepth());
 var mc:Object = eval("templates"+i);
 yPos += 50;
 mc._y = yPos;
 mc._alpha = 0;

 fadeInTemplates(mc);
}

function fadeInTemplates(mc) {
 mc.onEnterFrame = function() {
  if (mc._alpha<100) {
   mc._alpha += 5
  }else{
   //delete mc.onEnterFrame()
   //trace(1)
  }
 };
}
_______________________________________________
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

_______________________________________________
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