Hi everyone.
Ok… here we go. I’ve encountered this problem a long time ago but then i decided that it would be a quicker way to just do a workaround. Now i’m working on a completly different project and have the same issue again - so i’ve decided to get this one cleared. Anyway - lets cut to the chase.
Lets say that we have one single Movie Clip on the main timeline at frame 1. MC’s class is “Menu”. Inside that MC there’re 5 frames each representing a single page of a menu - for example frame 1: Main Menu, frame 2: Options, frame 3: Help etc. Inside every frame there’re a number of buttons each with UNIQUE (yes, i’ve doublechecked that) instance name. All buttons are in one layer, but there’re also couple of other layers containing artwork, script etc. Now i know that it seems that layers have nothing to do with anything - but trust me - somehow they do. Now the problem is that SOMETIMES buttons (and other object for that matter) get their instance names reset to default ones - “instance*”. I’ve never managed to get the pattern of why and when this occures but for example moving an object to a different layer sometimes ‘saves’ it’s instance name.
I’ve tried to reproduce this behaviour in an example that i would post here but i couldn’t - everything worked as expected - all instance name were correct :insomniac:. If you’re wondering how i’m checking the actual names of instances here’s the code (i’m running it in every separate frame):
var k:int;
for (k = 0; k < this.numChildren; k++)
trace(“Child number " + k + " :” + this.getChildAt(k).name);
I hope any of this makes sense and i’ve explained the problem clearly enough - i’m not very good at explaining - especially in english :te:
Thanks in advance for all your answers / suggestions.
Ok - an update. I realised that without a “working” example of this “feature” my post would be meaningless - so i’ve managed to create one - it’s in the attachement of this post.
Just open the *.fla and run it and look at the trace output - look at output for ‘Frame 5’ - you will notice alot of ‘undeclared’ instance names - though if you look at the actual frame in Flash you will see that every single object has an instance name assigned. Now if you move objects to different layers in frame 5 you will get different output results.
Now i’ll explain how to reproduce this - it will require more reading - so just bear with me.
The point is to create a frame with some objects, then copy that keyframe in timeline to another frame. Now if objects in initial frame don’t have instance names assigned to them (look at frame 4 in my example) then objects in copied frame will randomly loose their instance names even though they have them (frame 5 in my example).
…Well that is a mess of a post - i hope someone will understand something (-:.
P.S. Btw that *.fla file is in CS4 format - sorry about this - i just can’t get my hands on CS3 right now.