Funny, Danny. I'm hoping someday it will all be just one language.
- MM
You can tell that Michael is mostly a Director user, can't you? :)
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chatty
> Hi list...
>
> Simple question -- why doesn't the 2nd line work? The
> identifier expected error is traced at compile time.
>
> Thanks,
> - Michael M.
>
>
> function createObj():Void {
> this._data = new Object();
> this._data["a"] = {"1":new Number(0), "2":new
> Number(0), "
Thanks everyone for the responses. This thread has been really helpful.
- MM
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fi
var data:Object=new Object();
data.a=new Object();
data.a.t1=0;
data.a.'t2=0;
Whoops - a stupid stray quote in the last line. Should of course have been:
data.a.t2=0;
Ian
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or sea
It's nothing to do with the 'a', it's the 't1' and such in quotes
that's the issue.
>>MJ> function createData():Void {
>>MJ> this._data = new Object();
>>MJ> this._data["a"] = new Object();
>>MJ> this._data["a"] = {"t1":0, "t2":0}; } // The quotes in this line are
wrong
Won't com
n Behalf
>>Of Rákos Attila
>>Sent: Friday, February 09, 2007 3:13 PM
>>To: Flashcoders mailing list
>>Subject: Re[2]: [Flashcoders] Identifier expected
>>
>>
>>MJ> OK, I see, so then curious why this script returns
>>compiler errors:
>>MJ>
MJ> OK, I see, so then curious why this script returns compiler errors:
MJ>
MJ> function createData():Void {
MJ> this._data = new Object();
MJ> this._data["a"] = new Object();
MJ> this._data["a"] = {"t1":0, "t2":0};
MJ> }
Because when using the object initializer operator, you cannot
Stop using new Object() and use {};
:)
I'm not experiencing the same issue you're having Jason. Not sure why.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listin
;
this._data["a"][1] = new Number(0)
...
}
Derek Vadneau
- Original Message -
From: "Mendelsohn, Michael" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
Sent: Friday, February 09, 2007 1:08 PM
Subject: SPAM-LOW: [Flashcoders] Identifier expected
>>[mailto:[EMAIL PROTECTED] On Behalf
>>Of Rákos Attila
>>Sent: Friday, February 09, 2007 2:31 PM
>>To: Flashcoders mailing list
>>Subject: Re[2]: [Flashcoders] Identifier expected
>>
>>
>>MJ> That's because you're still not refrencing an
>>-Original Message-
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf
>>Of Ian Thomas
>>Sent: Friday, February 09, 2007 2:47 PM
>>To: Flashcoders mailing list
>>Subject: Re: [Flashcoders] Identifier expected
>>
>>Uh,
lf
>>Of Ian Thomas
>>Sent: Friday, February 09, 2007 2:47 PM
>>To: Flashcoders mailing list
>>Subject: Re: [Flashcoders] Identifier expected
>>
>>Uh, Jason.
>>
>>There's nothing wrong with saying:
>>
>>var data:Object=new Object();
&g
Original Message-
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf
>>Of Mendelsohn, Michael
>>Sent: Friday, February 09, 2007 2:02 PM
>>To: Flashcoders mailing list
>>Subject: RE: [Flashcoders] Identifier expected
>>
>>Thanks Jason.
MJ> That's because you're still not refrencing an object that exists:
MJ>
>>>this._data["a"] = new Object();
MJ>
MJ> You're saying, Hey, _data, make your "a" property an object. But Flash
MJ> is saying, hold on cowboy, I don't see any property of _data called "a".
You are not right, it is tota
y.
Jason Merrill
Bank of America
Learning & Organizational Effectiveness
>>-Original Message-
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf
>>Of Mendelsohn, Michael
>>Sent: Friday, February 09, 2007 2:02 PM
>>To: Fl
oders mailing list
> Subject: RE: [Flashcoders] Identifier expected
>
> Thanks Jason. I see what you're saying. So I inited an
> object and then define it, but the below still errors. I was
> just hoping to be able to define my object with only one line of code.
>
> priva
Thanks Jason. I see what you're saying. So I inited an object and then
define it, but the below still errors. I was just hoping to be able to
define my object with only one line of code.
private function createData():Void {
this._data = new Object();
this._data["a"] = new Object
*can't use* {:}
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Erik Bianchi
Sent: Friday, February 09, 2007 10:25 AM
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] Identifier expected
2 issues:
1) identifiers are an expressi
Sent: Friday, February 09, 2007 1:09 PM
>>To: Flashcoders mailing list
>>Subject: [Flashcoders] Identifier expected
>>
>>Hi list...
>>
>>Simple question -- why doesn't the 2nd line work? The
>>identifier expected error is traced at compile time.
>
> As you have discovered you are not able to use numbers as
> keys in line objects.
That's not true.
Just wrote this and it works fine.
a = {};
a["a"] = {};
a["a"][1] = new Number(5);
trace(a["a"][1]);
-- 5
Works for me. You must be doing something else wrong.
I'm not sure why you're using n
"; trace(this[1]); but then you can use {:} type syntax.
-erik
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mendelsohn,
Michael
Sent: Friday, February 09, 2007 10:09 AM
To: Flashcoders mailing list
Subject: [Flashcoders] Identifier expected
Hi lis
As you have discovered you are not able to use numbers as keys in line
objects.
Trying to do what you do will however not change this. Only way to do
what you want would be to insert the indexes manually:
function createObj():Void {
this._data = new Object();
this._data["a"] = n
Hi list...
Simple question -- why doesn't the 2nd line work? The identifier
expected error is traced at compile time.
Thanks,
- Michael M.
function createObj():Void {
this._data = new Object();
this._data["a"] = {"1":new Number(0), "2":new Number(0), "3":new
Number(0)};
}
23 matches
Mail list logo