RE: [Flashcoders] display list overrides keyframes

2010-06-25 Thread Tony Fairfield
Thanks Juan - after many other attempts this is the approach I ended up
with.



Tony Fairfield
Programmer
Lifelearn, Inc.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Juan
Pablo Califano
Sent: June 21, 2010 8:25 PM
To: Flash Coders List
Subject: Re: [Flashcoders] display list overrides keyframes

A possible workaround could be adding a reset method that (re)initalizes
the
behaviour. You could move your constructor logic to this method. So,
your
constructor calls reset() when the object is first instantiated. Then,
when
neccesary, you could call this method to reset the behaviours (in a
frame
script in the timeline or where your code issues the gotoAndStop or
gotoAndPlay that changes the frame).

Hope this helps.

Cheers
Juan Pablo Califano


2010/6/21 Tony Fairfield tfairfi...@lifelearn.com

 Is there a way to overcome the following:



 I have a timeline file, with quiz buttons on each frame. Each button
is
 a duplicate of one basic movie clip with a linked class and a
 constructor that initializes the behaviour -- rollovers etc. For each
 frame, the buttons are named a1, a2, a3 etc. The problem is, I
 foolishly assumed that a new keyframe meant these would be considered
 all brand new buttons by Flash, and their constructor functions would
 dutifully fire afresh, and all would be well. Of course, they don't:
as
 far as the Display List is concerned, if there was a button called
a1
 in frame 1, and if there's a button with the same name in frame 2,
they
 are exactly the same button, to hell with the keyframe. Hence, no
 buttons after frame 1 will fire their constructor function. Even the
 state of the previous button -- if it had been selected - is applied
to
 the new button with the same name.



 Normally, I would have built something like this dynamically, adding
and
 removing the buttons, but I was given an exisitng file that was
quicker
 (I thought) to work with as is, than to rework into a single frame,
 dynamic file. I'm probably just going about things the wrong way. I
hope
 this is a fairly garden variety issue with a solution (other than
 abandoning the timeline approach).



 Thanks for any input.



 Tony Fairfield
 Programmer
 Lifelearn, Inc.

 67 Watson Road S, Unit 5
 Guelph, ON  N1L 1E3
 www.lifelearn.com http://www.lifelearn.com

 T: 519-767-5043
 F: 519-767-1101



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] display list overrides keyframes

2010-06-21 Thread Juan Pablo Califano
A possible workaround could be adding a reset method that (re)initalizes the
behaviour. You could move your constructor logic to this method. So, your
constructor calls reset() when the object is first instantiated. Then, when
neccesary, you could call this method to reset the behaviours (in a frame
script in the timeline or where your code issues the gotoAndStop or
gotoAndPlay that changes the frame).

Hope this helps.

Cheers
Juan Pablo Califano


2010/6/21 Tony Fairfield tfairfi...@lifelearn.com

 Is there a way to overcome the following:



 I have a timeline file, with quiz buttons on each frame. Each button is
 a duplicate of one basic movie clip with a linked class and a
 constructor that initializes the behaviour -- rollovers etc. For each
 frame, the buttons are named a1, a2, a3 etc. The problem is, I
 foolishly assumed that a new keyframe meant these would be considered
 all brand new buttons by Flash, and their constructor functions would
 dutifully fire afresh, and all would be well. Of course, they don't: as
 far as the Display List is concerned, if there was a button called a1
 in frame 1, and if there's a button with the same name in frame 2, they
 are exactly the same button, to hell with the keyframe. Hence, no
 buttons after frame 1 will fire their constructor function. Even the
 state of the previous button -- if it had been selected - is applied to
 the new button with the same name.



 Normally, I would have built something like this dynamically, adding and
 removing the buttons, but I was given an exisitng file that was quicker
 (I thought) to work with as is, than to rework into a single frame,
 dynamic file. I'm probably just going about things the wrong way. I hope
 this is a fairly garden variety issue with a solution (other than
 abandoning the timeline approach).



 Thanks for any input.



 Tony Fairfield
 Programmer
 Lifelearn, Inc.

 67 Watson Road S, Unit 5
 Guelph, ON  N1L 1E3
 www.lifelearn.com http://www.lifelearn.com

 T: 519-767-5043
 F: 519-767-1101



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders