ActionScript 3.0 :: Getting A Platform To Move Between A Certain Path?
May 19, 2010
I'm having a bit of trouble getting a platform to move between a certain path with AS3.
My code looks like this -
Code:
if (((_platform.x >= 300) && (_sp >0)) || ((_platform.x <= 50) && (_sp <0)))
{
_sp *= -1;
}
_platform.x += _sp;
where _sp is the speed at which the platform moves (currently at 7) and _platform is the instance name of the platform.
I want it to move between the coordinates 50 and 300 along the x axis. What it does is, moves along the x axis and as soon as _platform.x hits 300 I get this weird movement where the platform moves back and forth at this point.
View 3 Replies
Similar Posts:
Oct 3, 2011
i am an newbie as3 developer, and i am working on a basic, horizontal shooter platform game.and my question is: how can i make enemies move smart, towards the player? ( but ofcours you are in able to dodge)so like, an enemy is moving to me so when i am not dodging, it will hit the player.
View 2 Replies
Mar 10, 2009
I am working on making a picture move along a path but for some reason I can't get it to work. I have followed the instructions in my text book but the image just goes down at an angle to the bottom right of the stage instead of following the path I created in the motion guide.
View 3 Replies
May 3, 2009
I am working on making a picture move along a path but for some reason I can't get it to work. I have followed the instructions in my text book but the image just goes down at an angle to the bottom right of the stage instead of following the path I created in the motion guide.
View 1 Replies
May 17, 2009
I have finished a little game called "math match". The idea of the game comes from "math mountain", a game is for the player who must caculate some kind of mathmatic questions, if the answer is correct, the player will move along a predefined path in several steps. I am newbie for programming games, so I am not sure what I have done in moving the role is the correct one, although it works okay. I know in Flash CS3, I can use motion guid layer to make the role move along a predefined path, but it seems it's not good in the game, or I don't know how to control it in actionscript 3.0. So I used many 'marks'(little movieclip) along the path. That divide a path into small pieces of lines, so I can move the role along the lines. If the 'marks' is enough, the precise is enough, the movement works okay.
But I think it's quite not a good method. I don't know if there is any good algorithm to move the movieclip along a predefined path, and this path is random, is hardly to be described by any math equation. I think in Flash CS3, we can draw a path by author tools, indeed Flash CS3 use some algorithm to do that. If we can get that math equation, we can simulate the movement very precisily, but is it possible? I don't know.
View 7 Replies
Dec 1, 2010
i want to make 3 objects move in a square pathi tried to use guide layers but it didn't work good for both three objectsonly the first object followed the exact pathis there some other way to do it??
View 6 Replies
May 29, 2011
I'm working on a game right now where I'm going to have paths dynamically built by the user for multiple AI objects to "walk" along. I'll be detecting/redrawing the path only on user input but I'm still debating over the fastest possible method to update the movement of many AI objects "walking" along/up/down the given path. Think for example of pac man, but the level is dynamic. Right now I'm leaning toward building the enemies in a linked list of final classes and looping through the linked list calling a function in each of the AI objects to plot the next move along the path.
View 1 Replies
Mar 26, 2012
I have a motion tween that I have move forward along a path, is there any way I can make the motion tween then move backward along the same path and then forward again.... like a loop?
View 2 Replies
Mar 31, 2012
After read a lot about ball physics, watch some examples and few days of trying making pinball with bitmaps, I use simple (easy to work with) and fast performance Physics AS3 engine for bitmaps [URL] but still cant fix problem: if ball is moving too fast and object on path is too small, there will be no collision detection (code works perfect only with bigger objects or if ball is moving slower). I am not good at physics and maths. Here is function code which make physics for ball on every frame rate (but maybe its better to change it to setTimeout):
function showFrame(e:Event) // onEnterFrame{
var collisions:Array = collisionlist.checkCollisions();
if(collisions.length) // if collision{
var collision:Object = collisions[0]; // get collision information
var angle:Number = collision.angle; // get collision angle
[Code] .....
View 2 Replies
Jun 25, 2005
How can I make a Movie Clip move dynamically following a path given by a line?? Like.... the user can draw a line and the movlieclip moves following it ? how ?
View 1 Replies
Sep 7, 2010
I can't seem to figure out how to accomplish a fairly simple task: I have a simple graphic and I'd like to apply an "orbiting" effect to it - so that the graphic moves in a circle around an arbitrary point (without rotating around its own center).[code]...
View 1 Replies
Jul 18, 2010
So I've created a script where a mc is clicked on and the player can draw a path using the mouse. I'm trying to figure out how I can get the mc to follow the path drawn out by the player's mouse and when the player clicks again, it erases all of the path.my code is below
Code:
import flash.display.Sprite;
import flash.events.MouseEvent;[code].....
View 14 Replies
Sep 10, 2009
So, I have a tween where a movie clip starts at 0 alpha and ends at 100.. I want to move the clip to a new place on the stage, but when I do it creates a motion path.. Edit multiple frame doesnt work either, so how does someone move a tween if the tween doesnt have a tween path?
View 2 Replies
Nov 9, 2011
the same class is passed to the mxmlc compiler in SWF library as a symbol linkage class and again in a source-path. But the compiler uses the definition from the source-path so creating new instance of that class won't create new instance of the library symbol. How do I tell the compiler to prefer the definition linked to the symbol (the one dfrom SWC)?
I have my design assets in an FLA file and they are linked to classes (e.g. [URL]. Then I export those assets to a SWC library and pass it to the compiler. Now when I create an instance of the class (new MyAsset();) it will be a new instance of the library object.
But there are other classes too in the source folder (e.g. "com.myproject.model.*" so I need to pass the source folder to the compiler too. And that is the problem, now the compiler will use the MyAsset.as definition from the source path, not from the SWC where it is assigned to the library object so if I create new instance of MyAsset now it won't duplicate the library object.
View 1 Replies
Nov 24, 2004
Here's what i'm trying to do: Hide a MC depending on the path variable as:
[Code]...
Well that doesn't work, for some reason, i can't use a string as a multiple level path..
View 5 Replies
Feb 15, 2010
I was wondering if it possible to write up some AS that will take line paths that you have drawn and convert them into a Path object? For example say you drew a jagged line from left to write, would there be a way to have AS convert that into a Path object.
View 11 Replies
Aug 31, 2011
Is it possible to draw out a path in the flash editor, set its visibility to hidden, and use this path data to animate objects in AS3?
View 1 Replies
Aug 27, 2004
i have a quick question what is the syntax if u want to use parametrs to define a path inside a path? i mean:
[CODE]...
does anyone know.... it's very important!
View 6 Replies
Nov 9, 2011
This is a head scratcher. Why would a root relative path cause a Security Sandbox error.. but an absolute path to the exact same path work fine..
[Code]...
View 0 Replies
Apr 8, 2011
I am displaying some flash content on a fairly standard page. This works really well when the flash, xml file and html page are sitting together in the same directory.url...However, I want to display that same content in another page which is deeper inside the site but outside of the directory that houses the .swf and .xml files as well as the assets.[code]The js files are loading properly but the flash content is not, so I could use a little help getting that sorted out.
View 1 Replies
Apr 30, 2011
What does _level0,_parent and _root mean in flash?What's the difference between absolute path and relative path?
View 1 Replies
Apr 3, 2012
I am coming from flash to flashbuilder I have a directory, AS3_classes_dir, on my computer that stores all of my classes, including my greensock and papervision packages. In every flash app that I make I include that directory in the Source Path, so that I can import whatever I may need. Compiling in flash (using ctrl/enter) takes very little time; only the classes that are specifically imported are compiled.So today I did that in flashbuilder, included AS3_classes_dir via Flex Build Path/Source Path ... but now the compile time are a couple of minutes, even though I am not even importing ANY of the classes from within.
View 2 Replies
Dec 17, 2009
is there any possibility for loading flv or f4v on silverlight platform?
View 2 Replies
Dec 1, 2005
is there a way to use actionscript to figure out if a player is using a pc or mac?
View 1 Replies
Aug 29, 2007
I have this problem when i go to shot and then have shot the gun all movie clips accessed after shooting dont stop playing but repeat continuously[code]...
View 1 Replies
Feb 22, 2009
I have a character on the stage (_ball_mc) which you control with the arrow keys. I also have a rectangle movieclip on the stage (this). I want this rectangle movieclip to act as a block platform.ie. When the character jumps ontop of it he can walk across it, if he walks into it from the left he cant move left any further, same with the right side.These movieclips are not being created at runtime, they are
on the stage.
My registration point of the character is bottom right,
my registration point of the block is top left
I've used the following ENTERFRAME with not much luck.Stopping the character from moving any further when he walks into the block seems to be ok. I'm having trouble getting him to land on the block without conflicting with the leftDown and rightDown.As this is such a common gaming element, I figure there must be some documentation on this ?
View 1 Replies
Dec 13, 2010
Can write server-side scripting LCCS has a good server-side frameworkBut why youtube did not use p2p technology flash platform
View 5 Replies
Oct 15, 2009
Our team is about to start a SAAS web application geared toward small businesses. This is a completely new experience for us; we are a system/ linux/php development organization and no experience whatsoever developing client side software except for simple html/php based CRUD support applications.We are evaluating both Adobe Flex and JQuery. We can't seem to choose between the two. Our priorities are:Productivity - We have to launch the soonest possible time.Overall User Experience - Resulting apps have to look professional and user must have pleasant experience using our product. I think this not a problem with both platform, though we will probably automatically lose 10% of potential users who don't have flash installed.Skill Reuse - We will all have to learn new language(s) and RIA platform on this project and hope we can use it again on more projects. BTW, we are a software contracting organization and this is our first foray to consumer apps. We are hoping though that we can leverage the skills we gain here for our clients.
Data-centric - Lots and lots of CRUD operations.3-tier - Business logic will reside on PHP server and data will be on the MySQL. The RIA will only present the data to the user.User accessible data will be large - This is why we decided to use RIA. We can't refresh the page when user just made few alterations/additions.Security is paramount - I don't see any security implication on choosing one platform over the other but perhaps the community has some ideas? We are carefully studying this. We frequently hold competition among developers who can implement a test app faster by using a flex or jquery. We would love to hear what the community have to say though.
View 7 Replies
Sep 17, 2011
If you wanted to distribute a program to as many OS as much as possible what's the best language to use? I'm considering user's convenience here. For example, they don't need to download java run time, flash or .net framework if they don't have it. Also once they download it, they don't need to compile it themselves.
I'm also considering developer's convenience, in that on one compile, the program compiles different version of OS for you and you don't need to install different os to compile it. Here are the features of the program I'm thinking: Stores text and image to database Uses keywords Can browse information in the webserver via xml Can share(upload and download) information from the web server via xml Can compile and edit related articles via keywords It's something like a blog with advance features and can exist on and offline
View 5 Replies
Sep 28, 2011
Is there any platform/compiler for creating flex application online? Any version will work. I know some action script online compiler but not able to find any flex online compiler.
View 2 Replies