Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-17-2004, 04:43 PM   #1
mcmcom
Asleep At The Keyboard
 
mcmcom's Avatar
 
Join Date: Jun 2004
Location: Toronto, Canada
Posts: 2,528
Default 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
mcmcom is offline   Reply With Quote
Old 08-17-2004, 04:55 PM   #2
Gibberish
WHAT!?
 
Join Date: Aug 2004
Location: San Diego, CA
Posts: 1,774
Default

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();
Gibberish is offline   Reply With Quote
Old 08-17-2004, 05:09 PM   #3
mcmcom
Asleep At The Keyboard
 
mcmcom's Avatar
 
Join Date: Jun 2004
Location: Toronto, Canada
Posts: 2,528
Default

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>
mcmcom is offline   Reply With Quote
Old 08-17-2004, 06:27 PM   #4
Gibberish
WHAT!?
 
Join Date: Aug 2004
Location: San Diego, CA
Posts: 1,774
Default

Sorry I am not sure. For some reason It looks like you are mixing code languages though.
Gibberish is offline   Reply With Quote
Old 08-17-2004, 06:31 PM   #5
mcmcom
Asleep At The Keyboard
 
mcmcom's Avatar
 
Join Date: Jun 2004
Location: Toronto, Canada
Posts: 2,528
Default

i dunno, i think flash likes any code it can get! it works though...so we wont fix it!
mcmcom is offline   Reply With Quote
Old 08-17-2004, 07:52 PM   #6
chartrandi
::Trying to learn AS::
 
chartrandi's Avatar
 
Join Date: Jul 2003
Location: Ottawa, Canada
Posts: 108
Default

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.
chartrandi is offline   Reply With Quote
Old 08-17-2004, 07:52 PM   #7
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

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?
tg is offline   Reply With Quote
Old 08-17-2004, 07:53 PM   #8
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

var temp=[];
would be for an array.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 08-17-2004, 07:54 PM   #9
annexion
I make out with chicks
 
Join Date: Oct 2002
Location: NYC
Posts: 1,586
Default

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.
__________________
www.perpetuated.com
annexion is offline   Reply With Quote
Old 08-17-2004, 07:54 PM   #10
chartrandi
::Trying to learn AS::
 
chartrandi's Avatar
 
Join Date: Jul 2003
Location: Ottawa, Canada
Posts: 108
Default

right
chartrandi is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:02 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.