List Info

Thread: Quiet today




Quiet today
country flaguser name
United States
2007-07-30 19:28:26
Hmm... quiet here today. Well, I can take care of that. 

I got my slider class working (big thanks to all those who
contributed!),
subclassing MovieClip.

The movie clip is the slider handle, and I set the linkage
to SliderClass.

Then I realized that I needed about 10 different sliders,
with slightly
different behavior (mainly what to display as you're
dragging it). So I
started wrote a SliderClass subclass, AgeSliderClass. It has
its own init(),
with a call to super.init().

I'm declaring it like this:
var ageSlider:AgeSliderClass = myRoot.attachMovie(yada
yada);

The problem is, the symbol in the library is linked to the
superclass. I
thought the compiler would recognize AgeSliderClass as a
subclass, and call
its init(). It's not, though--it's calling the superclass
init
(SliderClass).

Other than creating 10 instances of the slider handle in the
library and
linking them to the appropriate subclass, is there any way
to make the
slider handle of type AgeSliderClass, the sub-sub class?

Cordially,

Kerry Thompson


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: Quiet today
country flaguser name
United States
2007-08-03 16:49:30
Please ignore this. I sent it Monday just before the list
went down. I
figured out the answer.

Cordially,

Kerry Thompson

> -----Original Message-----
> From: flashnewbie-bounceschattyfig.figleaf.com
[mailto:flashnewbie-
> bounceschattyfig.figleaf.com] On Behalf Of Kerry Thompson
> Sent: Monday, July 30, 2007 8:28 PM
> To: 'Flashnewbie Mailing List'
> Subject: [Flashnewbie] Quiet today
> 
> Hmm... quiet here today. Well, I can take care of
that.
> 
> I got my slider class working (big thanks to all those
who contributed!),
> subclassing MovieClip.
> 
> The movie clip is the slider handle, and I set the
linkage to SliderClass.
> 
> Then I realized that I needed about 10 different
sliders, with slightly
> different behavior (mainly what to display as you're
dragging it). So I
> started wrote a SliderClass subclass, AgeSliderClass.
It has its own
init(),
> with a call to super.init().
> 
> I'm declaring it like this:
> var ageSlider:AgeSliderClass = myRoot.attachMovie(yada
yada);
> 
> The problem is, the symbol in the library is linked to
the superclass. I
> thought the compiler would recognize AgeSliderClass as
a subclass, and
call
> its init(). It's not, though--it's calling the
superclass init
> (SliderClass).
> 
> Other than creating 10 instances of the slider handle
in the library and
> linking them to the appropriate subclass, is there any
way to make the
> slider handle of type AgeSliderClass, the sub-sub
class?
> 
> Cordially,
> 
> Kerry Thompson
> 
> 
> _______________________________________________
> Flashnewbiechattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
> 
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: Quiet today
user name
2007-08-03 18:31:56
Hi Kerry,

> Other than creating 10 instances of the slider handle
in the library and
> linking them to the appropriate subclass, is there any
way to make the
> slider handle of type AgeSliderClass, the sub-sub
class?

The I-didn't-tell-you-that way of handling this would be to
keep the
constructor empty, and then change the clip's prototype:

var slider = myRoot.attachMovie( yada yada );
slider.__proto__ = AgeSlider.prototype;
slider.init();

You don't actually have to set the MovieClip's linkage for
that to
work, btw. Anyway, it's not good.

The better alternative would be to use composition. Have
your
MovieClip's linkage to your Slider class, handle all the
basics there
(moving the handle, calculating the value), and send out an
event or
call a callback whenever the value changes.
You AgeSlider and the others get the parent MovieClip passed
to the
constructor, attach a Slider MC to it, subscribe to that
slider's
onChange event, and do the special stuff when the value
changes.
That's the clean, flexible way to do it.

HTH,
Mark



On 7/31/07, Kerry Thompson <alphacyberiantiger.biz>
wrote:
> Hmm... quiet here today. Well, I can take care of
that.
>
> I got my slider class working (big thanks to all those
who contributed!),
> subclassing MovieClip.
>
> The movie clip is the slider handle, and I set the
linkage to SliderClass.
>
> Then I realized that I needed about 10 different
sliders, with slightly
> different behavior (mainly what to display as you're
dragging it). So I
> started wrote a SliderClass subclass, AgeSliderClass.
It has its own init(),
> with a call to super.init().
>
> I'm declaring it like this:
> var ageSlider:AgeSliderClass = myRoot.attachMovie(yada
yada);
>
> The problem is, the symbol in the library is linked to
the superclass. I
> thought the compiler would recognize AgeSliderClass as
a subclass, and call
> its init(). It's not, though--it's calling the
superclass init
> (SliderClass).
>
> Other than creating 10 instances of the slider handle
in the library and
> linking them to the appropriate subclass, is there any
way to make the
> slider handle of type AgeSliderClass, the sub-sub
class?
>
> Cordially,
>
> Kerry Thompson
>
>
> _______________________________________________
> Flashnewbiechattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om
>
_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: Quiet today
user name
2007-08-03 18:52:18
On Aug 3, 2007, at 7:31 PM, Mark Winterhalder wrote:

> The I-didn't-tell-you-that way of handling this would
be to keep the
> constructor empty, and then change the clip's
prototype:

um...eww

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net



_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: Quiet today
user name
2007-08-03 21:31:24
On 8/4/07, Kerry Thompson <alphacyberiantiger.biz>
wrote:
> I've filed your e-mail in my Flash programming folder,
though, and I'll
> probably look at it for the next project.

Keep Troy's reaction to manipulating the prototype chain
right next to
it -- this was just academic information, I wouldn't ever
use that in
production code. It /is/ fun to play around with, though.

Mark
_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )