08-17-2004, 04:43 PM
|
#1
|
|
Asleep At The Keyboard
Join Date: Jun 2004
Location: Toronto, Canada
Posts: 2,528
|
what does this mean? => var temp={}
var temp={};
is that a null array?
thanks!
mcm
Last edited by mcmcom; 10-13-2004 at 06:03 PM.
Reason: More Useful title
|
|
|
08-17-2004, 04:55 PM
|
#2
|
|
WHAT!?
Join Date: Aug 2004
Location: San Diego, CA
Posts: 1,774
|
i would think that is a syntax error? It looks like you just named the varaible temp to equal {}
Woulnd't null array be like var temp = array();
|
|
|
08-17-2004, 05:09 PM
|
#3
|
|
Asleep At The Keyboard
Join Date: Jun 2004
Location: Toronto, Canada
Posts: 2,528
|
it cant be a syntax error, i got it from a working component!
in C its a null array. heres the rest
<code>
var boole=["bold","italic","underline","bullet"];
for (var i in boole) {
this[butMCs[boole[i]]].chn=boole[i];
this[butMCs[boole[i]]].onRelease=function()
{
var temp={};
this.value=!this.value;
temp[this.chn]=this.value;
selected.setFormat(temp)
}
</code>
|
|
|
08-17-2004, 06:27 PM
|
#4
|
|
WHAT!?
Join Date: Aug 2004
Location: San Diego, CA
Posts: 1,774
|
Sorry I am not sure. For some reason It looks like you are mixing code languages though.
|
|
|
08-17-2004, 06:31 PM
|
#5
|
|
Asleep At The Keyboard
Join Date: Jun 2004
Location: Toronto, Canada
Posts: 2,528
|
i dunno, i think flash likes any code it can get!  it works though...so we wont fix it!
|
|
|
08-17-2004, 07:52 PM
|
#6
|
|
::Trying to learn AS::
Join Date: Jul 2003
Location: Ottawa, Canada
Posts: 108
|
from what I gathered in the last few months,
var temp={};
is like saying to flash "I need to create an array, so keep that in mind...right now it's empty but later on I'd like to populate it"
and later in the code the person probably added code to populate the array using 'push; or some other command.
|
|
|
08-17-2004, 07:52 PM
|
#7
|
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
|
Quote:
|
Originally Posted by mcmcom
var temp={};
|
its the same as:
Code:
var temp=new Object();
its just a shortcut.
__________________
tg
---
what the hell was i thinking?
|
|
|
08-17-2004, 07:53 PM
|
#8
|
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
|
var temp=[];
would be for an array.
__________________
tg
---
what the hell was i thinking?
|
|
|
08-17-2004, 07:54 PM
|
#9
|
|
I make out with chicks
Join Date: Oct 2002
Location: NYC
Posts: 1,586
|
That's an object.
You could similarly, though not exactly, do the same with
var temp = new Object();
This is just like the usages of:
var temp = new Array();
var temp = [];
- to create an array, except the above is for an object.
|
|
|
08-17-2004, 07:54 PM
|
#10
|
|
::Trying to learn AS::
Join Date: Jul 2003
Location: Ottawa, Canada
Posts: 108
|
right
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 05:05 PM.
///
|
|