ActionScript 3.0 :: Multidimensional Arrays - Maze Is Not Being Displayed Correctly?

Feb 6, 2010

I have some working code that I created in C and ported over to the PSP. I decided that I wanted to work with it in flash and ported it over to AS3.0. It took me a bit to get used to the graphics commands but over the course of a few days I managed to get the code typed in. I compiled it and watched my baby come to life in a new environment. But there was something wrong, everything looked correct but felt wrong. I looked closer and saw what the problem was. The maze is not being displayed like how I put it in.First let me give you some visuals to look at.

[Code]...

When I run the program this is how flash displays the mazeThe starting position is the bottom left corner. Which in flash terms is 13,1. Why oh why is flash rotating and then inverting the map? If row = 13 and col = 1, then [row-1][col] should equal 12,1. I've broken it down and analyzed it till my brain hurt... I can not find any reason for this bizarre behavior... All the program does is interpret the 1's and 0's to know where to place a wall. If the square has a 1 then a wall goes there, if not then its open and the player can walk there. I look at the surrounding squares and then draw what I see... no rotating and no inverting is done.I remind you that the code works as intended in C. So I don't think its a coding issue.

View 10 Replies


Similar Posts:


Professional :: Flash Movie Not Displayed Correctly In IE 8 On Some Windows OS

Aug 24, 2010

I'm using CS4 to export a basic flash movie with embed tags pre scripted. And the issue is that on some OS systems using Vista or Windows 7 and IE 8 as a primary browser, it appears that IE 8 is not displaying the flash banner completely.... its CROPPING it off... This is very strange because the banner works fine in FireFox, IE7,Opera,Chrome but not I.E.8 on some OS systems...
 
If you google "Flash not displaying correctly in IE 8" you'll get alot of people with the same issues but no real definate fix...
 
what i could try? Do i need different flash embed tags? Or is this a user issue?

View 7 Replies

ActionScript 3.0 :: Flash Animation Is Not Correctly Displayed In Firefox

Jul 28, 2009

Why the flash animation is not correctly displayed in Firefox ? (and only the second time I visit the website)[url]...

View 1 Replies

ActionScript 2.0 :: Utlizing XML With A Pix Gallery - Pictures Are Not Displayed Correctly

Mar 28, 2004

this is the first time I'm actully utlizing XML with a pix gallery. I exeprience problems when surfing the gallery in a browser, however, not when I'm just executing the swf file. The problem is that some of the pictures are not displayed correctly.

View 8 Replies

ActionScript 2.0 :: Getting Values Out Of Multidimensional Arrays?

May 17, 2009

In my example I have established root items (item1,item2,item3 and item4) and sub-items underneath them, and I can easily access the values at the sub-level, but I can't figure out how to output the values on the root level, if I use treemenu[0] it doesn't output "item 1" but the values on the sublevel, how can I point to the actual value on the root level? so it would output for example "item 1"?

Code:
var treemenu:Array = new Array(new Array());
treemenu.push("Item 1");

[code]....

View 2 Replies

Sorting Multidimensional Arrays With No Identifiers?

Jul 6, 2010

I have this array

Code:
_global.itemsSelected[1][0]=20;
_global.itemsSelected[1][1]=60;
_global.itemsSelected[1][2]=10;

[Code]....

View 2 Replies

ActionScript 3.0 :: Compare Two Multidimensional Arrays Against Each Other?

Feb 3, 2010

i need to compare two multidimensional arrays against each other
 
var aa:Array = new Array(1,2,3);
var bb:Array = new Array(1,2,3);
if(aa == bb){
trace("same")
}
 
dose not seam to worke, even in a 1d array :/

View 3 Replies

ActionScript 3.0 :: Initializing Multidimensional Arrays?

Jan 31, 2010

I am new to flash programming and am trying to create an empty 2D array.I have the Code:

ActionScript Code:
var squareList:Array = new Array(new Array());
Init();

[code]........

View 1 Replies

ActionScript 3.0 :: How To Pass Multidimensional Arrays To PHP

Apr 27, 2010

I do not understand how to pass an array to PHP! I have a number of multidimensional arrays that I would like to pass over.

Example:
array1 -
character[0][0] = "dog";
character[0][1] = "cat";
character[1][0] = "dog";
character[1][1] = "frog";

View 0 Replies

ActionScript 3.0 :: Referancing In Multidimensional Arrays?

Mar 10, 2011

Below you can see this rotation-towards-mouse experiment I wanted to try out. I made a tilemap using a 2D array and my objective was to get all the "hands" pointing towards the mouse. I almost got it working in the sense that all of the "hands" are rotating but they are all rotating the same way, namely they all rotate exactly like the last hand - i.e. the last object in the array.You can try it with this code to see what I mean. You just need two movieclips in the library, one called Hand(preferably not a circle) and the other called Ball but it can be anything.

I actually tried using similar code involving a drag-and-drop function and that worked fine. I could move around each tile separately but for this to work it seems I have to add the listener differently. At least that's my theory but I haven't found the correct way.his is probably super-simple but my googling and trial-and-error'ing haven't turned up anything yet

ActionScript Code:
var hand:Hand;
var tileMap:Array = new Array();

[code]....

View 1 Replies

ActionScript 2.0 :: Creating The Multidimensional Arrays?

Sep 13, 2006

what i owuld like to do is ceate flash collections

name:value
name2:vale2

similar to collection in cfml and hash tables in vb.net is this possible or do i have to create multi dimensional arrays?

View 1 Replies

ActionScript 3.0 :: Shuffling Multidimensional Arrays?

Jan 15, 2010

I'm pretty sure this is a common requirement but a bit of googling hasn't provided me with a satisfactory answer so far.Basically, I need to shuffle a 2d array of Points (co-ordinates) so that they are still the same co-ordinates, but stored in a different order.

View 1 Replies

ActionScript 2.0 :: CS3 Multidimensional Arrays - Assign The Values Of 0 And 1?

May 12, 2009

So I'm coding a maze in Flash using ActionScript 2.0. I'm using a 2D array and with that I will give each point a value, either 1 or 2. I then plan to use modulo and an if else statement to pull a brick movie clip from my library. Here's what I've coded so far with the 2D array. This is my first time using this array and I'm unsure wwether I have coded this correctly. how do I use this array now to assign the values of 0 and 1?

[Code]...

View 2 Replies

ActionScript :: Push To Multidimensional Arrays And Later Retrieve Just One 'row'?

Jan 20, 2010

I am reading a set of latitude & Longitude Coordinates that define a polygone area. They are keyed to an area ID and I retrieve them from a SQL database. So for example, Area ID 153 might have 20 coordinates and area ID 77 might have 11 coordinates. I wish to save these in a 2-D array indexed by the area ID, and where each coordinate pair is combined into one Google LatLng object. At a later point I wish to retrieve just one row i.e. the set of coordinates for one area, and send them to a function that accepts an array of coordinates and draws the polygon on a map. Here's what I have:

private var coordsFromSql:ArrayCollection = new ArrayCollection();
var polyArray:Array = new Array();
for each(var item:COORDINATES in coordsFromSql)

[code].....

View 2 Replies

Arrays :: Flash As3 Best Way To Create Multidimensional Array?

May 13, 2011

I have an array of movie clips (representing band members) which have various properties, among them them a property which tells where the band member went to after they left their current band. For those who formed a new group, I want to create an array. Within that array, I want to group all the ones that left for the same group into secondary arrays. So, if you had five band members and 2 of them left for group X and 3 left for group Y. What's the best way to do this? This is, roughly, my code:

[Code]...

Alternatively I suppose if I could do without a multidimensional array and just loop through all the members and say - for those members whose group is the same, perform this function, with the name of that same group passed as the parameter for the function. I guess the trouble I'm having is identifying who's the same.

View 2 Replies

ActionScript 2.0 :: Create Multidimensional Buttons With Arrays?

Nov 29, 2010

I am creating a menu buttons with the use of array. A reference link is given below. --
grandmother.increating such associative buttons with array (actionscript 2).

View 0 Replies

ActionScript 2.0 :: Generating Empty Multidimensional Arrays?

Aug 15, 2004

This works:

[code]...

But when I try to generate an empty array with two variable dimensions using

[code]...

I get a 1x10 array. What am I doing wrong? Is this wrong:

[code]...

View 1 Replies

ActionScript 3.0 :: Inserting New Values Into Multidimensional Arrays?

Jul 1, 2011

TL;DR version: how do I add more values to the 0th row of an array?[If that's too vague, read on.]What I'm trying to do currently is make a tilemap engine. I have an multidimensional array that is sifted through when the program begins that determines what type of tile is added to the stage which was then put in its appropriate place. These tiles scroll when the player moves.

Now, the problem is, I expect to make huge maps. Putting a large amount of children (tiles) on the stage makes the program incredibly laggy, so to fix this I created another multidimensional array that held the values of the tiles that are currently in the field of vision of the player.

the values in the new array shifts and moves along with the player, gets the children that will be left behind and deletes them. To keep things short, the player would not notice the addition and removal of the tiles, because the tiles are added at the position where the player is currently moving and the tiles that are removed are removed where the player is moving away from.

The issue I am having lies with moving up and down. The addition and removal of tiles follows a very strict process:

1. shift the array that holds tiles in the player's range of vision so that new tile values can be added.

2. add children (tiles), assign their names, add the name to the appropriate place in the array and move the child (tile) to the appropriate place on the stage.

3. Delete the tiles left behind.

4. Remove the names of the children that were deleted from the array.

To move up, I would have to unshift the array (so that all the rows move down one), add the names of the new children(tiles) that will appear directly above the range of view, then delete the children that are named in the last row of the array and pop the last value in the array (which, since this is a multidimensional array, is not one value, but the entire last row of children names). The problem is, after I unshift the array and add a new row with only a single value in it, I can't add more values into the row!

(the name of the array that holds the names of the children in the player's range of view is containmentUnit.)

I have tried these,

Code:
containmentUnit[0].push("test");

Code:
containmentUnit[0].splice(0, 0, "test");

but it always comes out the same way-- with an error message that reads:

TypeError: Error #1006: value is not a function.
at storage/update()

how I could add some values to that first row?

View 4 Replies

ActionScript 2.0 :: Generating Empty Multidimensional Arrays

Aug 15, 2004

This works:

Code:
var game:Array =[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],

[Code]...

I get a 1x10 array. Is this wrong:

Code:
for(v=0;v!=vlength;v++){
game[v]=new Array(hlength);
}

Ow eh im using Flash MX2k4 v7.2

View 1 Replies

ActionScript 3.0 :: Using Multidimensional Arrays - Correct Move Onto The Next Level

Sep 27, 2011

I may be confusing myself as I seem to do this whenever working with multi-D arrays... but perhaps you guys can set me back on the right track. I'm working on a flash application that is kind of a game. It's a memory test consisting of 10 blocks, it is very similar to the one shown in the video below.... but there are some differences where this one wouldn't for my situation. (apparently I can't link) The title on youtube is Spatial Span... it will be the first result if you search for "Spatial Span" The difference is that there are 2 sets to every level and you only need to get 1 correct to move onto the next level.

[Code]....

View 0 Replies

Actionscript :: Flex - Defining Indexed Array - Using Multidimensional Arrays

Oct 25, 2009

I have problems defining indexed array with actionscript. The task is following. I have a board of point objects. I need to store them into one array, so I can access each point using simply it x,y coordinates. for example to get point one I want to be able use points[1][1], etc. I read the doc here [URL], and realized that I don't understand how to initialize array for my needs. (Especially when it can contain from 10 to 15 rows and columns, so it will be quite hard to use following notation: masterTaskList[0] = ["wash dishes", "take out trash"];, as suggested in docs.) What I am doing is:

[Code]....

View 3 Replies

ActionScript 3.0 :: Multidimensional Arrays - When Test The Movie , The Output Panel Displays NaN Instead Of 117.89?

May 16, 2011

I'm just beginning to learn AS3 and I've been reading Colin Moock's Essential ActionScript 3.0.(I've been doing some exercises on how to randomly choose elements from arrays). All of the book's example codes that I've tried so far (in FLASH CS5) seem to work pretty well. But I'm having a bit of problem with the example code below which is found in chapter 11 (Arrays):

var row1:Array = [6, 2.99]; // Quantity 6, Price 2.99
var row2:Array = [4, 9.99]; // Quantity 4, Price 9.99
var row3:Array = [1, 59.99]; // Quantity 1, Price 59.99[code]....

When I test the movie the output panel displays NaN instead of 117.89.

View 2 Replies

ActionScript 2.0 :: Multidimensional Length - Get The Length Of Arrays Within An Array

Dec 16, 2004

I am trying to get the length of arrays within an array, here is my example (MX 2004):

[Code]...

I get an output of of 3. the number of variables within the first array, this is not what I had expedted.

View 2 Replies

Arrays :: Search Multidimensional Array (Flash As3) Using Another Array For Search Criteria

Sep 26, 2011

Long story short: I want to search a multidimensional array in AS3 for (in this example) the location of 6 strings - all of which are stored in another unrelared array. Long story long: Once I get the locations (in the multidimensional array) of each string, i then know where it's located, and can access other atributes of that object - so if i found the string "box3" is located in element [5] of my multidimensional array, i can now target: multiArray[5][3] to return the 4th item stored (keeping in mind we're starting from 0, so 3 is the 4th position).

I can get this to work once, but I'm trying to set up a for loop based on the length of my basic string storage array - this array holds (in this example) 6 instance name strings - each time my for loop loops, i need to run a search in my multdimensional array for the next consecutive instance name. Then, once I've located all of them (and store the results in a new temporary array) I can dig around in each location for the info I need.

[Code]...

View 3 Replies

Add Lazers To A Maze Game?

Jan 7, 2011

I've just finished making a maze game similar to the "Scary Maze Game" and would like to add lazers around the maze to make it harder to get through.

So basically when youre mouse cursor hits the lazer you lose, id like the lazers to either swing side to side or just appear every X amount of seconds.

View 8 Replies

Actionscript 3 :: Hit Testing For A Maze?

Apr 21, 2011

I am making a maze game and i have the edge of the maze as a movieclip. I'm trying to test if the player hit tests the maze to make him stop using this code.

If(player.hitTestObject(Maze))
{
function()
}

But wether or not It's actually touching the maze (it's in the empty space on the inside) it always registers as touching.

View 2 Replies

Create Flash Maze Game

Mar 10, 2011

I am creating a Simple Flash Maze Game,and i have 2 'Movie Clips' that i want to react when the collide.IE. When 'CHAR_LVL1' (A Movie Clip, controlled with the Arrow Keys) comes into contact with 'WALL_LVL1'. I want it to 'gotoAndStop(27);'[code].I am using Flash CS5 and Action Script 2.0

View 1 Replies

ActionScript 2.0 :: CS3 Hack-proof Maze Game?

Jul 22, 2009

I'm making V.2 of a maze game I made a while ago [URL] I want this version to be unhackable only I can't find any tutorials

View 2 Replies

ActionScript 3.0 :: Developing A Flash Maze Game?

Feb 13, 2009

I am developing a flash maze game and I have a problem with changing direction of my movie clip. I can move around my maze and I have a hit test sorted. But what I want is when a player presses a keyboard button, the first animation of the MC rotating will be played, then when the play head hits stop the MC will stay in this same position (pos from last frame) until another key for example up is pressed.

[Code]...

View 1 Replies

ActionScript 3.0 :: Simple Maze Game (Pac Man Style)

Jan 29, 2010

I want to create a really basic pac man style maze game, its actually for some marketing materials and it will be really used as means of navigation rather than as a game, I want pac mac to eat certain words and when that happens it will tell the user about that topic. What the best way for pac man to work his way around the maze would be? Would I be best using hit detection? Also what would be the best way to remove the pellets as he eats them? visibility or remove child?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved