I guess it's BASIC's in variables but

Hi,
I have a MovieClip instance called: MC1
I have a Dynamic textfield called: DynT1

I’m doing a page which includes a dynamic text scroller.
This text scroller uses both elements: the dynamic textfield and the MovieClip in which this dynamic textfield is contained.

The scroller engine (a MovieClip) contains AS with several calls to both elements, so if I want to use this scroller in other pages belonging to the same site I have 2 options:

1- Duplicate the scroller MC as many times as I need (and change those instance names for every specific scroller)
2- Assign these instance names a variable name in the same frame the scroller is, resulting in the following:

Frame X
var1=“MC1”;
var2=“DynT1”;

Frame X+1
var1=“MC2”;
var2=“DynT2”;

…and so on. This way I can use the same scroller MC for ALL the pages I need it in…At least this is the theory.

What I have in the scroller engine are instructions such as:
[AS]
if (_parent._parent.MC1.DynT1.maxscroll<=1)

_root.MC1.DynT1.scroll = percentScrolled*(_root.MC1.DynT1.maxscroll0.010000);

_root.MC1.DynT1.scroll = _root.MC1.DynT1.maxscroll;

_parent.MC1.DynT1.scroll = percentScrolled
(_parent.MC1.DynT1.maxscroll*0.010000);
[/AS]

And by doing such change I have…
[AS]
if (_parent._parent.var1.var2.maxscroll<=1)

_root.var1.var2.scroll = percentScrolled*(_root.var1.var2.maxscroll0.010000);

_root.var1.var2.scroll = _root.var1.var2.maxscroll;

_parent.var1.var2.scroll = percentScrolled
(_parent.var1.var2.maxscroll*0.010000);
[/AS]
Fine…it does not work… Why?
I guess it must be something really stupid. I’ve tried
var1=“MC1”;
var2=“DynT1”;
and
var1=MC1;
var2=DynT1;
and other changes without success.

Could anybody give a hand with this?
Thank you.

Hi,

[AS]
//Frame X
var1=_root.MC1;
var2=var1.DynT1;

//Frame X+1
var1=_root.MC2;
var2=var1.DynT2;
[/AS]

Either that or:

[AS]
var fieldToScroll = eval(_root+"."+
var1+"."+var2);

_root.var1.var2.scroll = percentScrolled*(fieldToScroll.maxscroll*0.010000);
[/AS]

SHO

Hi eki.
Thanks for your help. However, I’'ve tried your both sytems but it’s still not working. I have no-idea what can be wrong with it…

I’m desperately open to more ideas ! :A+:

HI,

Sorry man

_root.var1.var2.scroll = percentScrolled*(fieldToScroll.maxscroll*0.010000);

should be:

fieldToScroll.scroll = percentScrolled*(fieldToScroll.maxscroll*0.010000);

SHO

Hi eki.

I had already seen that lil “lapsus”. However this is still not working…It’s really getting on my nerves the amount of hours I’m spending with such a simple thing (in theory).
I’ve made a very simple EXAMPLE (6 Kb) showing how it works.
Perhaps this way it’s easier to see what’s wrong.

In this example everything’s fine for that is the version prior to the “var” changes I explained above.

Thank you very much for your interest.
Manare

I’ve got to go now , I’ll have a look at it tomorrow, ok?