This content has been marked as final. Show 2 replies
Your going to have to show us some code.
The way you say every 20 frames, sounds a little suspicious. Generally it isn't such a good idea to combine timeline with Actionscript. So there may be a looping problem or some such.
Well basically i have this piece of code:
ObjectHolder1.attachMovie(WhichObject[objectnumber], "Object1_mc", 0);
which runs in the timeline of a scene every 20 frames.
WhichObject is a list containing the 10 names of the different movie clips, objectnumber is a random number.
There are 4 ObjectHolders, so in frame 1 is the code above, in frame 20 is:
ObjectHolder2.attachMovie(WhichObject[objectnumber], "Object2_mc", 0);
So the entire timeline is 100 frames then it loops. Most of the movie clips that are attached are 50 frames long, 1 of them is 100 frames (so the object falls more slowly).
the movieclips are unloaded after 50 frames or 100 frames depending which movieclip is attached using
ObjectHolder1.unloadMovie("Object1_mc"); inside an if statement which determines which movieclip is playing from variables which are set when the clip is attached.
using Trace() and debug mode it seems that sometimes (apparently randomly) the .attachMovie line of code doesn't work when i run the movie. But when i put a breakpoint on this line and run it in debugger it seems to always work.
Does that make it any clearer? I hope so i'm quite desperate. I am a bit of a newbie so i appreciate that i have probably chosen a terrible way of creating this, all advice is appreciated.