Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-09-2012, 04:20 AM   #1
funkii39
Registered User
 
Join Date: Aug 2011
Posts: 46
Default declaring Arrays

sorry if , this seems quite lazy
maybe someone knows better than my
google search (if you have such time) and clearer
than my actionscript for games book._plain stupid-just;whatswrongwiththis
var _firstrow:Array;
_firstrow=new Array();
_firstrow=[1,2,3,4,5];
var _secondrow:Array;
_secondrow=new Array();
_secondrow=[6,7,8,9];
var _thirdrow:Array;
_thirdrow=new Array();
_thirdrow=[10,11,12,13,14];
funkii39 is offline   Reply With Quote
Old 06-09-2012, 08:15 AM   #2
xdeath
Deaths touch!!!
 
xdeath's Avatar
 
Join Date: Mar 2008
Posts: 776
Default

perhaps its just me, but what are you asking?

because all your code is doing is creating 3 different arrays. each with a different set of numbers inside. the code also has no errors, so it will work. so what exactly are you asking?
xdeath is offline   Reply With Quote
Old 06-09-2012, 05:49 PM   #3
[afz]snickelfitz
Senior Member
 
[afz]snickelfitz's Avatar
 
Join Date: Dec 2011
Location: Tucson, AZ
Posts: 2,397
Default

ActionScript Code:
var _firstrow:Array = [1,2,3,4,5];

BTW, leading underscore is a useful naming convention for class properties that have getter and setter.
ie: getter and setter expose the name "firstrow", while the internal (hidden) class property uses "_firstrow".
[afz]snickelfitz is offline   Reply With Quote
Old 06-10-2012, 03:48 PM   #4
rrh
throw a trace() in there
 
Join Date: Dec 2006
Posts: 1,982
Default

_secondrow=new Array();
_secondrow=[6,7,8,9];

is especially redundant, since the [] pattern is creating a new Array instance. You're creating an empty new Array, then immediately throwing it away to replace it with a pre-populated new Array.

Like, these are equivalent:
_secondrow=new Array();
_secondrow=[];
rrh is offline   Reply With Quote
Old 06-11-2012, 07:49 PM   #5
funkii39
Registered User
 
Join Date: Aug 2011
Posts: 46
Default

thanks a whole bunch Guys! yeah one member said 'No errors' but -somehow there were errors!~It was ???kinda a long one. The last response also does (thank.) look like an example in my Actionscript/Flash books!! Cheers
funkii39 is offline   Reply With Quote
Old 06-11-2012, 07:51 PM   #6
funkii39
Registered User
 
Join Date: Aug 2011
Posts: 46
Default

if your wondering, why i asked its because i have been programming
for 30 weeks now! and also my eyes are known to be somewhat stigmatised! You guys are the bomb.
funkii39 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 11:36 PM.

///
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.