Flash :: Represent Tiles In XML?
Jun 28, 2010
So, I'm writing an AS3 program that tiles floor tiles. I want the user to be to be able to create their own floor schematic represented by different rectangles. It'll be drag-and-drop. They will lay out their schematic (which is composed of different size rectangular tiles) and drop colors/patterns onto them.
This schematic will then be tiled on a 3D plane to represent what the actual floor would look like.
I've got the 3D part working, drag-and-drop working, etc. What I'm missing is the floor schematic stuff. I've spent a lot of time trying to figure out the best solution, but I can't QUITE get there.
Here are some examples (out of a WHOLE bunch of possible combinations) of how the floor schematics could look:
The different tiles within the schematic are the droppable regions. My problem: How can represent these schematics in XML? Don't worry about tiling, sizing, etc. I've got that all figured out already. I just literally do not know how I can represent a tile schematic in XML and draw it correctly with AS3.
View 4 Replies
Similar Posts:
Oct 21, 2010
I want to generate thumbnail image from a flash file,
View 1 Replies
Jun 22, 2011
I have a lot of employee data. Then i want to show to user the data using flash animation.Is it possible to be done with flash animation with delphi ?
View 1 Replies
Aug 17, 2010
I am currently working on a project that involves dropping objects (scrabble letters) onto different cells in a table. My project also involved multiple levels. My layout is rather basic. I have a a bunch of tiles (25 letters) above a 2-columns table (left side for definition, right for answers). The table is static from frame 1 til the end (no keyframe, blankframe, etc.). The problem is as follows: The exercise starts fine with the first Level, then I click a button to access the next level, and so on... Going FORWARD on the timeline seems to be working OK, I am able to complete each levels in succession. However, if I decide to go backwards (replay a previous level) I can no longer place tiles on my table (hitTestPoint not returning what it should). I checked and my "target" is indeed there but somehow the hit test does not register.
[Code]...
View 1 Replies
Jan 20, 2009
I have 4 Sliders that I want to represent 100% of a total Number; Say the number is 100 and you start all the sliders off at 25. Each Slider has a Min of 0 and a Max of 100, to represent 0 to 100 percent of the Total number.So if one slider is all the way to 100% the rest of the 3 are at 0%;
Example: All Sliders are set to 25, and you slide the top slider to the right (increasing) say to 40%; The Sliders should say 40%, 20%,20%, and 20% since it would decrease the rest of the sliders accordingly, so they all add up to 100%;.
View 4 Replies
Jan 5, 2012
I'm trying to make a question game with 30 question divided into 3 dificulties, so i'm using arrays to have my questions randomized but not repetitive.
I made the code use the first parameter of the array (array[0]) then remove it from the array.
So, my array will have no more elements after a time. But, when my array have only 1 element, i cant play this element, and i need to use the representation of the empty array to get it to play.
I'm new on AS3, so this may seem very confusing. Here is the code I used.[code]...
View 1 Replies
Jun 30, 2006
i have an some movie clip objects, named A,B,C,D,E respectively. Also, asssumed i have 3 arrrays, globally defined with
Array1={'A','B'};
Array2{"B","C"};
Array3={"C","D",E","B"};
Finally, i have some buttons there, both will be used to trigger the movie clip to change it's alpa value. Now here is the problem, when i click on button1, it will search in Array1, and those elements match the object name will be triggered.For example, i click on button1, and it search Array1, which contains elements A, B. With these elements, it only match movie clip object named A and B only.
So as a result, only these two objects are triggered.
Can you let me know what is the concept to run this? The requirement must use the elements in an array to trigger an object. For more information, i actually need this concept to create a Search Algorithm, such as breath first search and depth first search method. So after it find a solution path from A to B and C, which these similar to array1={"A","B","C"}, so only the node A, B and C will be highlighted, and a line from A to B and B to C is drawn to visually show the path.
View 1 Replies
Feb 25, 2011
I'm working with a Sprite in AS3. Initially, width,height are 0,0 as expected.
After this:
var tf : TextFormat = new TextFormat();
tf.font = "Arial";
tf.size = 48;
[code]....
View 2 Replies
Sep 7, 2011
I'm getting a millisec timestamp in ActionScript as a Number object which can return a primitive double. I'd like to cast it for a backend that expects a primitive long long millisec, however the language does not provide long long. Am thinking a double can be converted to two ints and submitted together. Any encounter something like this and have a solution?
View 1 Replies
Mar 20, 2008
i would like to basically represent a group of cells multiplying and dyeing. I have some data im pulling in, from an xml file and would like this to generate some cells. I have figures that change frequenly, so for example, if the figure increases i would like the cell to multiply and if the figure decreases i would like cells to die off.
If any one point me in the direction of some examples or give me some ideas about the best way to do this i would really appreciate it.
As you can see im not sure if i should be looking at flocking or recursion etc so
View 1 Replies
Apr 13, 2004
I went to [URL] to turn a GIF image into arrays that represent each pixel. How do I take the code that it spits back at me and display it in Flash MX?
View 2 Replies
Aug 1, 2004
Is the number in a function representing the speed (in case of easing) equal to a certain amount of frames?
View 10 Replies
Feb 9, 2010
I'm making a game and I need to represent a "layered" circle in some clever datastructure.A circle can have any number of layers. Each layer has a number of "slices", they can be of different lengths and pieces can be missing. The innermost layer is always a full circle.Each segment has a color, multiple segments with the same color can be next to each other. Realistically a circle wont have more than about 40 layers or about 1500 individual slices.I will need to be able to easily find adjacent pieces to a specific piece, see if a piece is "hanging in free air" (imagine gravity towards the center), and to remove pieces leaving a hole in their place.
View 7 Replies
Dec 6, 2005
Just curious to know if its possible. I have a nav that is in flash and will be in many .asp pages. Could a corresponding button in the nav stay highlighted to represent where a user is by detecting what page it is on?
View 5 Replies
Sep 20, 2002
I've created a small application that links various Sound Clips to corresponding Sound variables, and the individual start and stop commands work fine. However, when I try altering the volume, the controls affect all the sounds in the movie. I'd like to refrain from creating separate SWF files to represent each sound, but I will if I have to.
View 1 Replies
Dec 7, 2009
How do you make tiles in AS3? I can't find any good tutorials that actually teach it. I'm wanting to create an isometric tile based game, but I don't understand how to make the objects line up together.
I have an isometric engine in AS2 but I don't know how to get it into AS3.
View 5 Replies
Oct 25, 2009
I've been experimenting with path finding, in particular the A* algorithm. I've understand the basics for it and can currently get an object to move from point A to B avoiding walls. However I'm trying to create one way blocks, (then eventually add turn left and right only and T juncs etc) so I don't have to use thick walls to prevent the object from taking a certain route. The code I have so far is....
[Code]...
View 1 Replies
Sep 17, 2010
I'm trying to place tiles on background. I have a tile (20X20) on stage ( 600X400px) and I have declared it as a Symbol of Class BgTile (also have checked to export for actionscript), Problem is that it is working only partially. Some Tiles in the second row are missing and a (or more) tile(s) is(are) placed at the origin (Registration point is in the center) strangely.
function CreateBG():void{
for(var i:uint=0;i<20;i++){
for(var j:uint=0;j<30;j++){
var tempBG=new BgTile();
tempBG.name="tile"+i+j;
addChild(tempBG);
getChildByName("tile"+i+j).x=j*20+10;
getChildByName("tile"+i+j).y=i*20+10;
}}}
CreateBG();
View 4 Replies
Oct 12, 2010
I'm trying to learn how to make grids using the Vector method. I have my tiles set at 100x100. I made a function to layout the first set of tiles in the first column. Here is my function:
public function Grid():void { for ( var i:int = 0; i < 5; i++) groundTileList.push(new Ground_tile()); var column:Ground_tile = groundTileList[i]; addChild(column); column.x += 100; }
[code]....
View 3 Replies
May 24, 2011
I have a .png file with 16x16 tiles that I want to make into their own variables. I've tried using BitmapData like this:
bitmapData=new BitmapData(16,16,true,0x000000);
bitmapData.draw(loader);
bitmap=new Bitmap(bitmapData);
addChild(bitmap);But I then realised that would only work for the top-left tile of the picture. How would I be able to get the rest of the tiles?
View 2 Replies
Nov 9, 2009
This is my first time using Actionscript in probably 4 years and I'm learning everything all over again. For example, here's what I tried to jump right into doing and just realized I don't remember how. I'm trying to generate a world map out of tiles I created in Photoshop. I've created a symbol in the library for each tile and want to use an array and a for loop to create the full map.
So far I seem stuck on creating the array itself. I've started by creating a variable for each tile that exists such as m73 = "Lake South" where "Lake South" is the name of the symbol in the library. The full map will be a 32x32 grid of tiles but for now (until I get it working) the array is much smaller. An example of it is like this:
worldMapArray = [m4,m4,m4,m4]
[m0,m4,m4,m4,]
[m17,m16,m16,m16];
Hopefully this is enough to convey what I'm trying to do. However, when I use something like trace(worldMapArray[0][1]); it comes up as undefined. I've already created the needed for loops that use attachMovie for each iteration in the array, but as the array itself isn't set up right nothing happens.
View 1 Replies
Mar 12, 2011
following a recent question below is the code for a grid with different size tiles
Code:
var mcWidth:Number = 50;
var mcHeight:Number = 50;
var spacing:Number = 5;
var numberOfRows:Number = 3;
[code]....
View 0 Replies
Mar 18, 2011
I found the following code online for a Flash Memory Game. You click on pairs on grey tiles, when you click they reveal a color and when the two colours match the tiles disappear.
The problem I'm having is that the tiles are too big and I need to resize them. However when I do only the first 9 of 16 tiles are resized. It's as if the nested loops calculate the first 9 tiles and the last row and column take up whatever space is left.
Anyway lines 19 and 20 are the ones in which the tiles are calulated:
tile.x = (x-1)*50;
tile.y = (y-1)*50;
Code:
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
[Code]....
View 4 Replies
May 5, 2011
I have an engine for platformer game and I need to generate random blocks while moving and of course delete old ones, when the hero leave pervious position.Here is the code for generating random platforms when the game starts (costructor):
ActionScript Code:
public function TheGame()
{
bla-bla...
[code]....
As you can see, I create a loop which creates 10 platforms in different positions.My goal is to create a function which will delete blocks from the array which are not in the stage anymore and create new blocks when screen is moving up.
View 2 Replies
Mar 5, 2012
I'd like to display a group of squares following a pre-determined path to create rows. Like row 1 to 10 would be Row1(), 11 to 20 Row2() and so on. The main reason for this is to hide the Menu before actually showing/building it. After the Menu is build up, I could remove the squares any way I want to reveal the Menu behind.
View 0 Replies
Jan 7, 2007
Basicly this should work just like a non OOP tile game board. It just stacks the tiles on top of each other and never changes the color. So I assume that _root.cname is the wrong way to referance it.
Code:
//Create beginning variables
var checks_ver:Number = 8;
[code].....
View 3 Replies
Dec 29, 2009
I create a board using the class Baldosa (which is a tile on my .fla file with 9frames, each is a tile of a different color). I first create and array of numbers which indicates which frame (color) the baldosa element will display. As grey baldosas are more than the other colors (this is intended), then I unsort the array to avoid grey baldosas accumulating on the right side of the board. Then I push each baldosa in an array, and add each of them as child of the contenedorBaldosas(container) to avoid adding events for each Baldosa.
The problem comes when I want to check collisions. If there's a collision, I swap positions of each Baldosa. It only works if I swap the tile at depth number 0 and the last at depth 79, for the rest of Baldosas, it doesn't detect any collision (the baldosa clicked will return to its original position as nothing had happened. I made a trace and it seems the baldosa clicked doesnt collide with another baldosa in the array (each baldosa is given the name baldosaxx using the variable in the for loop), but rather an unnamed instancexxxx.
Also I'm treating the baldosa elements as Sprites, but as the baldosa in my .fla is a MovieClip, and it contains a Timeline where each frame is a baldosa of a different color, the problem may be also here.
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
[Code] .....
View 1 Replies
Apr 20, 2011
I'm working on a tile game and need to figure out an equation.. I have a grid which is 12x11.. when I place a tile I need to check the existance of other tiles on the same row and column and add up their values..I need to create an equation with the following variables :-
Receives a number between 1 and 132 :-
divides and/or multiplies the number into all the possible divisions of 12 in between 1 and 132 adds or subtracts the correct amount of tiles which lie either side dependant on it's position(I have drawn out the grid, and, for example, tile 66 has five tiles either side, tile 121 has 11 to it's right because it's in the bottom left hand corner)
View 10 Replies
Aug 9, 2011
I have the Bitmap data from a Loader object and I would like to slice it up into 32x32 squares to use as tiles. What is the most efficient way to do so?
View 2 Replies
Apr 11, 2011
Here's the functionality I am trying to achieve: I have 30 tiles on my stage. I can move them around through multitouch like this:
ActionScript Code:
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.events.TouchEvent;
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
for(var i:int = 1;i<=30;i++){
this["tile"+i].addEventListener(TouchEvent.TOUCH_OVER, onBegin);
}function onBegin(e:TouchEvent):void{
e.currentTarget.startTouchDrag(e.touchPointID)
}
What I want to happen is that when a tile is released on another it snaps to that tile and they become one tile so when moving around you actually move them both. When you release the 2 tile 'hybrid' onto another tile it becomes three tiles together and so on.
View 0 Replies