Mike,
Evaluation order and scoping is a difficult area of Mathematica. It takes considerable experimenting to understand it. I do not have a good reference but I believe there are some threads in the forum that talk about references. Generally the tutorials in the documentation are good. This scoping is especially hard when you use Manipulate, Animate, and Dynamic.
The problem with your formulation is that you used functions to create a list of expressions and then wanted to use that list as a function inside a dynamic construct. This gets complicated. For example,
In[46]:= aa = Expand[(x + 5)^3]
Out[46]= 125 + 75 x + 15 x^2 + x^3
In[47]:= bb[x_] := aa
In[48]:= bb[g]
Out[48]= 125 + 75 x + 15 x^2 + x^3
Note that bb failed to have the proper definition. This is analogous to what you are doing. One way to fix it is to force aa to evaluate immediately.
In[49]:= bb[x_] := Evaluate[aa]
In[50]:= bb[g]
Out[50]= 125 + 75 g + 15 g^2 + g^3
You have a similar problem with gList -- it is an expression in t
but you want to substitute in values for t
as if it were a function (similar to what I did above). My suggestion would be change your approach and construct circle piecewise functions so that they are functions of t
and then they will behave as you expect.
circ[y_, r_][t_] := Circle[{f1[t], y}, r]
gList = Table[circ[0, i], {i, 1, 2}]
{circ[0, 1], circ[0, 2]}
I made a function circ that returns a function of time. Now gList is a list of functions -- not expressions. I can apply each of these to a time and they will produce a circle at that instant in time.
Animate[Graphics[Through[gList[tp]],
PlotRange -> {{-5, 5}, {-4, 4}}], {tp, 0, 10}, AnimationRate -> .5]
The function Through just applies each function in my list, gList, to the argument [tp]. Essentially giving you {c1[tp], c2[tp], ... cn[tp]} where c1, c2, ... are circle functions of only time. Now this behaves as you expect. Its a list of functions that animate without having to worry about scoping of variables.
You could also do this with Map instead of Through if it is more clear:
Animate[Graphics[Map[#[tp] &, gList],
PlotRange -> {{-5, 5}, {-4, 4}}], {tp, 0, 10}, AnimationRate -> .5]
I hope this helps (and did not make things worse!)).
Regards,
Neil