OZONE Asylum
Forums
Multimedia/Animation
Multi-Dimensional Arrays in AS
This page's ID:
22525
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
hi all, Motivated by the 20 liner compeition in the DHTML/JS forum i've set about trying to create my own landscape/heighfield rotater thing. I come from a C programming background and i thought it'd be pretty easy to just attach a load of movie clips to the stage and put them all (well references to them) into a 2d array so i could call back to them with ease for the moving and the jiggery pokery. This is what i think sets up a 2d array called point_set, pretty strange syntax a mon avis... [code]point_set = new Array; point_set = [[],[]];[/code] then as i attach the clips i do this: [code]vertex = attachMovie("mcPoint", "n"+total, total); point_set[[i],[j]] = vertex; [/code] where total is just a simple counter var. So far so good, but when i try and use the old nested for loops to actually reference parts of point_set, like this: [code]onEnterFrame = function() { for (j=0; j<height; j++) { for (i=0; i<width; i++) { node = point_set[[i],[j]]; // rest of the function... [/code] i only manage to get teh end five. The concept of the end is a bit weird due to the screen co-ords being annoyingly offset instead of nice carteisan. The [url="http://www.relain.co.uk/stuff/flash/landscape.fla"].fla is here[/url], its not very elegant so far but you never know. The actual rotation is pretty amusing too, still i should be able to sort that out.
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »