Duplicate instance names on different frames? Bad idea?

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.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 2nd, 2005, 05:56
New Member
Join Date: Jun 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
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

  #2 (permalink)  
Old Jun 2nd, 2005, 07:25
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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:
Code: Select all
_root["tick"+levelNumber].play();
or whatever you want it to do. If you're not using this method of establishing the movieclip name in Flash then it probably won't work.
  #3 (permalink)  
Old Jun 2nd, 2005, 08:05
New Member
Join Date: Jun 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
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
  #4 (permalink)  
Old Jun 2nd, 2005, 09:53
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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.
  #5 (permalink)  
Old Jun 2nd, 2005, 11:55
New Member
Join Date: Jun 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for that mate. Don't really understand why it didn't work the way I was doing it but it all seems to be sorted now.

Thank you!
Closed Thread

Tags
duplicate, instance, names, different, frames, bad, idea

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 16:58.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43