[FMX]duplicateMovieClip being finicky

So i’m doing a game in black jack game in flash (for my new footer) and it’s going great except for trying to get the dealer to have some sort of intelligence about drawing new cards.

I want him to hit if he’s under 17, and stand at 17 and over.
Unfortunately, when I put the code in on the last frame of my card movie:

if(_global.cardtotalx < 17){
duplicateMovieClip(“cardx”, “newcardx”, 12);
setProperty(“newcardx”, _x, “220”);

it won’t duplicate the card.
I’ve tried the exact same code in an onClipEvent(load) and on onClipEvent(enterFrame) handler on the actual movie clip, just in case flash was picky about the code location, and it still didn’t work. I tried it on a button, however, and it worked just fine. My question is, is Flash finicky about duplicateMovieClip as a non-button triggered action? Normally I can get it to work, but always in a for loop. So CONFUSED!

I wish I could post the .fla, but I’m at work. Just wondering if there’s a simple explanation. Otherwise I’ll make it work somehow.

Thanks guys.


the difference is that button actions ON the button are in the scope of the current timeline while actions ON movieclips are in the scope of the timeline of THAT movieclip and not the current timeline. That being the case you would need to use


Thanks sen. Oddly enough, I tried that, and it hadn’t worked before, but then I ended up changing some variable assignments around and it eventually worked. Flash is like a 60 year old lady sometimes… set in her ways and irritable.

Thanks man.