IDE :: OOP/Event Related: Transition Game Tiles?
Oct 13, 2009
I'm working on OOP skills by creating a fun Mahjong game. I made a working concept (not very OOPed yet), and am trying to get everything OOPed before its too late. I want the tiles to transition in, maybe teleport in like a Star Trek movie. The tile object is a movie clip, so it can play the transition as it is added to the stage. Tiles will be added in, in increments so there's a cool wave-like effect of teleporting.
How would I know when the tiles have finished transitioning in? Would the tiles generate an events that the game object detects, starting the game after receiving X 'finished' events? Or should I create a timer in the game object where the amount of time to wait for the transition depends on the number of tiles being added to the board?
I think I'm close, but could use any general feedback on the concept. The coding is not an issue. I'm just trying to wrap my head around things.
View 2 Replies
Similar Posts:
May 25, 2010
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/removeChild() at latest_fla::MainTimeline/action()I get this error when i try to remove the instance of the ball after detecting collision over a wall.. i want the ball to disappear after it collides with the specific walls. i am new to AS and not ablt to sort out the problem. i am trying to make a game using AS3.0
View 12 Replies
Feb 22, 2009
Trying to add event listeners to check whether my tiles are being pressed! This works excellent! They respond to the listeners BUT on the mose_down/mouse_up i can�t trace the tile variables The listener functions:
[Code]...
View 3 Replies
Mar 24, 2010
I have the following code
TransitionManager.start(babyPreloader,{type:Fade, direction:Transition.OUT, duration:0.5, easing:Regular.easeOut});
var tempPreloader:DisplayObject = babyPreloader as DisplayObject;
this.removeChild(tempPreloader);
But since this does not wait for the transition to complete. I cannot see the transition happening. Is there a way to have a even listener for transition complete?
View 1 Replies
Dec 31, 2009
I am doing a small transiction using TransitionManager.start() function. how can i call a method after finishing the animation? i mean how to add event handler for this?
View 0 Replies
Jun 12, 2009
I have created a linkbar with two labels. Now, I need to keep a track of the label clicks.i.e. If in the beginning "First" is clicked, the details will be displayed. After that, if without submitting the details, "Second" is clicked then an alert message should come to inform the user that "First is still in progress, do you want to cancel and begin Second operation". Vice-versa for Second to First transition. I need to know how to write events to keep track of which button clicked.
View 1 Replies
Nov 16, 2009
How can I add a Squeeze transition effect between frames using the transition manager class on a simple slideshow using the goBack and goForward functions in ActionScript3? Below is the code I have so far:
stop();
function goBack(event:MouseEvent):void
{[code].....
View 0 Replies
May 18, 2010
i have a flex app that transitions between 2 states with the toggle of a button. my issue is that the effect of fading only seems to work on the 2nd transition and after. However, for my first transition... going from State1 to studyState... there is no fade effect whatsoever, in fact the components in state1 disappear completely (the footer fills the empty gap where the "body" use to be) and then the flex recreates the studyState (without any fade refilling the "body" with components only in studyState). After this first transition however, going between studyState and State1 working COMPLETELY fine.. why does this happen and how can i make it so that crossfade works STARTING FROM THE VERY FIRST TRANSITION?[code]
View 1 Replies
Oct 25, 2009
I have a presentation using the "presentation" template that comes with flash. I am trying to transition slides with the behavior slide transition options. but I've learned that it works find while going into a slide and doesn't go to the next slide when leaving.So basically I want it so that on right arrow first play out transition then go to next slide.
View 2 Replies
May 22, 2011
how can i pause and resume a game when it has more than one Enterframe Event?
View 2 Replies
Jan 19, 2011
I'm trying to develop a catching game, just for a bit of fun and learning experience. I've been bouncing between tutorials and I've finally come to a point where I can't get any further. After you catch three sandwhiches, you lose and it takes you to an end screen, however, I'm unable to stop the listeners from being called, and when the game restarts, the food falls, but you're no longer able to catch it or keep score.
[Code]....
View 6 Replies
Jul 28, 2009
I am doing a game but keep getting this error: Statement must appear within on/onClipEvent handler. This is the code I am using:
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
this._y-=10;
}if (Key.isDown(Key.DOWN)) {
this._y += 10;
[Code] .....
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
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
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
Jan 2, 2010
I try to create game Guess Number using classes...On .fla file i'm planing to have components like Button and TextInput from flash components library.Also i created GuessNumber.as with class GuessNumber.
Problems:
1) next line now working:
playAgainBtn.enabled = false;
2) after clicking to button i don't see event:
guessBtn.addEventListener(MouseEvent.CLICK, checkingYourGuess);
I attaged files also all code here:
package
{
import flash.display.Sprite;[code]..........
View 22 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
Apr 23, 2010
I am trying to create a page transition that will play a movieCLip transition into a page. and then it stops then when another button is pressed, it will play that transition out while loading the appropriate one. In the attached FLA, if you click on the red button first, the blue transition plays,
--red button code--
mybutton1.onRelease=function(){
_root.transitionClip.play();
}
and then stops on the stage. When you click the green button second,
--green button code --
mybutton2.onRelease=function(){
_root.transitionClip.play("out");
_root.transitionClip2.play();
}
it works correctly/ Playing out of the blue Transition and into the Red transition. However if I click it again it does the opposite, and just keep alternating.
If I add the
_root.transitionClip2.play("out");
to the first button then, nothing works right. I will eventually have more buttons, and may need to use a variable to control which "out" transitions is played, but how do I get the buttons to do this?I just want it to exit the current movie clip and play the "in" section of the desired clip.
View 16 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