This is a discussion on "Duplicate instance names on different frames? Bad idea?" within the Flash & Multimedia Forum section. This forum, and the thread "Duplicate instance names on different frames? Bad idea? are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Duplicate instance names on different frames? Bad idea?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Duplicate instance names on different frames? Bad idea?
Hi,
On the main timeline I have 10 frames, each a level if you like in a game. Its actually a little quiz. I have a symbol that is an MC of a tick being drawn to say when they have got the question right or not. I've got 1 of these on each of the 10 frames. Each with "tickMC" as their instance name. I trigger the anim to play depending on the answers to the questions. I check the answers with a function called "CheckAnswers()" (suprisingly enough) that sits in frame 1 of the main timeline. As I type this it's sounding very contrived and a bit overkill as if I'm going round the houses for a simple job. But flash is only a toy for me really and it won't affect the speed doing it this way I'm sure. The problem is though that the first question works fine. But then in the next frame "tickMC" has been played. You'd think it's because flash has just triggered all "tickMC"'s to play at once, but no. Results were stranger when I named each one "tickMC1"/"tickMC2"/"tickMC3"... etc. Then, the first one trigered fine. The second fine. But the third was already triggered when I got to it. I'd expect all or none would you? At that point I thought Flash was taking the piss out of me. But I persevered. So I traced what should have been triggered which I think was "tick"+levelNumber or something similar and it said it could not find the MC's after "tickMC2". Does that make much sense? I'm not feeling too articulate today. I hope you can see the general problem at least. Thank you for reading and sorry about the length. My girlfriend doesn't seem to mind though. Badum tish. Jon |
|
|
|
|||
|
I understand what you're saying and I see no reason why it should work, so your code must be wrong somewhere along the code.
Could you post samples of code, or perhaps upload the entire FLA file? The only hint I can give you from what you've suggested is to ensure you're targetting the movieclips correctly:
|
|
|||
|
Thanks for your reply, it should just work shouldn't it? I'm now thinking its some bug in Flash 5 (which is what I'm using by the way) which has been resolved in MX
Here's the fla. It's just a simple example one. Hope you can help. http://www.magic-carpet.freeserve.co...um_example.fla Edit: Only the first and second one play as I said, but interestingly on the third one nothing is traced, sugggesting the function hasn't been called at all. BUT, if you click the button 16 times or more then blank lines gets traced. Weird or what? Jon |
|
|||
|
It seems like they're all being treated as the same instance of the same symbol. If you rename the first framed MC to testMC1 then it doesn't work for the first frame, but works for the second.
From what I understand, you're trying to achieve a simple tick to say ' you got the question right', so why do you need a different tick for each question? Simply keep the same movieclip for all the questions and use actionscript to reset it when the frames are changed. So when entering a new frame, use gotoAndStop(0); and when the question is answered, tell it to play. Then reset it in the next frame again. If you want to remember previous answers to questions, use an array and set the movieclip according to each element in the array where an element corresponds to a frame. Usually when multiple instances of a movieclip are needed, duplicateMovieClip() is used, but this would not work across frames effectively. |
![]() |
| Tags |
| duplicate, instance, names, different, frames, bad, idea |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Domain Names Help | crackafaza | Hosting & Domains | 7 | Oct 19th, 2007 16:12 |
| duplicate content | dab42pat | Search Engine Optimization (SEO) | 25 | Aug 3rd, 2007 16:09 |
| Duplicate content | ScottR | Search Engine Optimization (SEO) | 6 | Jul 27th, 2007 13:36 |
| Masking a duplicate MC | eabigelow | Flash & Multimedia Forum | 3 | Oct 22nd, 2006 03:23 |
| Form names | spinal007 | JavaScript Forum | 4 | Oct 14th, 2004 11:03 |