Andy,
I see what you are saying, I think. That the .toString() has to be used
as a method directly being addressed by the object. Like I said that what I
think you are saying. How ever it seems I still can not get the string
"myMCinArray1" or "myMCinArray2" or "myMCinArray3" etc when I use the
toString on an array Element.
By the way, the scope in this case is actually the Array
lement(MovieClip) -see coded snippet
setInterval(rollOvers,10); //calls function 100/second to
function rollOvers(){
for (i=0; i<aArray.length; i++) {
aArray[i].onPress = function() {
var myStr:String = aArray[i].toString(); //***** THIS LINE
trace(myStr); // still traces [object object]
trace(i); //gives me 126 .which is the array length. if I
could get this to give me the value of the Array element clicked I would
fine too.
};
}
}
Again any follow up on this post would be appreciated.
Paul V.
----- Original Message -----
From: "Andy Herrman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[email protected]>
Sent: Tuesday, September 11, 2007 12:00 PM
Subject: Re: [Flashcoders] toString(aArray[i]) ?? does this work
> I think what you really want is this:
>
> var myStr:String = aArray[i].toString();
>
> I don't know of any global toString() function. What's probably
> happening is that you're doing the equivalent of
> `this.toString(aArray[i])`. The scope object's toString function
> ignores all arguments and gives you the string representation of
> itself (which will be what you said you're seeing unless it has a
> custom toString() implementation).
>
> -Andy
>
> On 9/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > Quick question, can I toString an array element.
> > ie: var myStr:String = toString(aArray[i]); // where 'i' is the
increment.
> >
> > I am having an issue with this. when I trace myStr it traces [object
object]
> > instead of what I intended/expected "mcMovieClipName14" as a string.
> >
> > Any insite would be appreciated.
> >
> > Thanks in advance,
> >
> > Paul V.
> > _______________________________________________
> > [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
> >
_______________________________________________
[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