I think Laurent was trying to cast the value of a variable with a
dynamic name to a number and not the dynamic name "s"+i to a number
which can be done like this:
// assuming flashSQL.MoveNext["var8"+i] can be cast to a number
// you can do it like this
this["s"+i] = Number( flashSQL.MoveNext["var8"+i] );
However, the text property of a textfield takes a string value, not a
number value so casting to a number is inappropriate for the .text
assignment.
Hope this helps,
James
James O'Reilly
www.jamesor.com
Merrill, Jason wrote:
//var ["s"+i]:Number = flashSQL.MoveNext["var8"+i];
//Number(["s"+i]);
That's like black magic or something. Several things wrong there. You
need to learn to use some traces in your code to know where it's
breaking, but basically, the array access operator is used to evaluate
an object name in an object. So in other words, you need to use the
proper scope
this["rec"+i]
Means (on a frame script), the current timeline: rec1 instance, rec2
instance, rec3 instance, etc.
Also, name your instances starting with 0 instead of 1, will be easier
for you since arrays start at 0.
for (var i = 0; i<7; i++) {
var myTempNumber:Number = //whatever you do to get the number
this["rec"+i].text = myNumber
}
Also, s+Something will never be a number - no numbers I know of start
with "s".
Hope that helps,
Jason Merrill
Bank of America
Learning & Organization Effectiveness - Technology Solutions
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com