ActionScript 3.0 :: Dragging Only X And Y Direction?
Feb 4, 2010i am developing a flash game where i need to drag movie clips but i have to allow dragging only two direction x and y.
View 1 Repliesi am developing a flash game where i need to drag movie clips but i have to allow dragging only two direction x and y.
View 1 Repliesi want to drag objects using startDrag() method only one direction either X or Y .
View 1 Repliesi have a scroller developed in as2. it basically scrolls continuously in a direction until the direction of the mouse is changed. the images of course loop in the continuous scroll. now the problem is that for 10-15 photos its ok. but when i feed it with 180 photos, it seems to show only 11. why would this be? any restriction on flash ??
View 1 Replieshave a ball with the name of mc which can be moved using the keyboard .. when you press the left mouse button shoots the ball, this ball and the other flies in the face where the cursor was in the shot .. but if you move the cursor to another location and shoot a second time then the second ball is also flying in the direction of the cursor and the first ball change direction toward a second shot ..
ActionScript Code:
import flash.display.MovieClip;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
[Code]....
how to make that first ball did not change its direction and continued to fly in the direction of the shot?
I designed a horizontally oriented page that expands to the right. The problem is, the content goes off the screen.
I want to know how to make all of the content on the website scroll with the mouse direction like this webpage- sectionseven.com
Does anybody know how to do this or something similar?
I need a code in AS2 that launches a bullet ("bullet") from the character ("hero") towards wherever you clicked the mouse.For example, if I click somewhere, I want the bullet to launch straight towards where I clicked.
View 10 RepliesIt is really nice to see the new text direction for TLF but i have one problem with it.We are trying to localize our flash application using strings. so far we follow the traditional way of translating each string and assign it with ID. Our 2 main languages are English and Hebrew. The problem is that for english we need to use LTR direction while in hebrew it is RTL.in a big flash application were the number of tlftextfields are big it is impossible for us to change the direction for individual tlftextfieldsin .
View 5 RepliesI need a push in the right direction. I have been programming ActionScript 3 for about a year and am just starting to separate my code out of the Flash using classes and things like that.
Anyways here is the problem. [URL].. Go here and upload an image and notice how when you drag the image a black box still appears to visually show the image is under the Obama logo image. I am trying to figure out how this was accomplished.
First: Is a mask being used to only show the image in that particular area? Or is this an transparent gif above the uploaded image? If a mask is being used then how is the rectangle achieved and how is the drag and drop still working when the mask hides the image?
Second: How is this box effect being achieved? Those are the most important questions. I figured out how to make an image resize using a slider. However I am curious how this guy did the advanced image resizer.
If someone can point me in the right direction as to how this is accomplished that would be great. [URL]..
I have a AS3 script where I'm using a TextFiled Object. I retrieve the text from the database with the help of a PHP script. The problem is how can I use RTL direction in a TextField Obj?
View 1 RepliesI posted a thread last week and I get a code that give me possibility to move circle in the stage and when it got to the end of the stage it turn around and change it's way. but the code was only for X direction but I want to use it in Y direction too, to move the circle diagonal. I put the code down here. me to add Y position guide me how to add.
ActionScript Code:
var circles:Array = new Array();
var quantity:int = 2;
[code]....
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]...
Press the picture to get it larger. That's what i really need for my project. I can't get it to work.please explain it for me to, im learning flash so I can need that to understand sometimes
View 1 RepliesI am having a problem with this actionscript, i post it on my mc but it doesnt work. (except for the turning it just wont go forward or back)
CODE:
onClipEvent (enterFrame) {
//This code will advance the car forward.
if (Key.isDown(Key.UP)) {
speed += 1;
[code]....
I have had the following problem for a while and i cant find any solution on google.I have the following and what i want to do is only allow the object current_switch_selector to be dragged in a horizontal direction but when i use the following for example it doesnt work
var bounds_rect:Rectangle = new Rectangle(0, 0, 17, 10);
trace(bounds_rect);
current_switch_selector.startDrag(bounds_rect);
[code]....
I'm making a game that is birds eye view like the old grand theft autos. anyway im currently stuck at this... I can have my character fire and have the bullet follow my mouse but I cant seem to figure out how to just make the bullet go straight off the screen in the direction my character is facing.
View 2 RepliesRecently an associate of mine and I built this site www.grievewinery.com. It seems to be working fine for everyone EXCEPT the owner himself. I am at a total loss. I have checked it on 4 MACS and 7 PC's of all different browsers and variations. I have asked them to try all variations on the URL, such as leaving off the http, the www - any and all ways possible. Nothing. For the life of me I cannot surmise why the owner himself would not be able to view the site unless he had a typo or needed a FLASH update, of which he would be prompted as such, correct?
View 4 RepliesI have more reach application, in simplify my problem looks so:
I dont' need in scroling. How do it? With JavaScript? or exists decision in ActionScript 3?
I want to know how if a movieclip is going += ._y or -=._y
View 1 RepliesWith mx:Box I can set the direction to be either "horizontal" or "vertical". I'd like to reverse the order of the components in the box though. For example:
Before:
|button1| |button2| |button3|
After:
|button3| |button2| |button1|
I've created a custom component that lives in a mx:Box and would like to do this in as simplest a way as possible.
Flex Effects include "isPlaying" property to check whether Effect is currently playing or not. But is there a way to find out what is the direction of playback (whether the play was started with playReversedFromEnd)?
View 1 RepliesI wanna detect the direction of mouse movement. If the mouse moves tpwards the left or right of its currrent position, i want to detect it. Is there anyway to identify such movement. Actually i am implementing a 360 degree rotation of image. That means , if the mouse moves along the left side of its current position, then the image should move along its left side, otherwise it should move along the right side. For example, view this site:
View 4 Repliesi want to make my box animation come up from left to right direction, right now my box appear from top to buttom, how can i change my move direction of the box from left to right, i have nine box and three each other line, like picture below.here is my current code
function random_item()
{
var listItem:Array = new Array();[code]...........
how do i make the animation from left to right,
I have small popup box which expands from size zero to some size when clicked on the expand button.
The location of this expand button is dynamic.Hence I want to change the the direction in which this expansion happens depending on the position of the expand button.
For example if the expand button is at the bottom right corner of the stage i want the popup box to expand upwards and leftwards.
If the expand button is at the top left then i want the popup box to expand downwards and rightwards.
I have only one movieclip for the popup box with the registration point at the top left corner.
I tried to achieve this by dynamically changing the registration point of the popup box movieclip using the DynamicMovie class. But no luck.
If I manually change the registration point it is working.
So I'm trying to make basic sprite control with the keyboard so that he walks right when the right arrow key is down. At the time I'm not worrying about him actually moving, but just the sprites.
Now after I press right once, when I release he stays there. I realize that it's because there's no command to go back to a standing sprite. But when I put that command in, since flash has no key release control, every time you let go of right OR left he always returns to facing right.
So I'm having trouble make him face the way he was walking when you let go of a certain key, but all my attempts have failed.
given the x & y speeds, how do i calculate the direction of movement?
View 3 RepliesI have a MC with a ball-movement, that I'd like to move in a specific direction, anytime on pressing A. Here's my code so far (the target is the center of the paddle); but it only does the last part and reverses the current direction.
ActionScript Code:
on (keyPress "a") {
endX = _root.pad._x;
[Code]....
I'm using a pretty standard sortCompareFunction in my DataGrid:
ActionScript Code:
protected function compare(valA:*, valB:*):int {
if(valA < valB) {
[Code]......
The trouble of course is that the compare function isn't passed any info about the column being sorted, and apparently the datagrid's click handler fires AFTER the sort is applied so that's no good either.
I am horrible at maths and I would like to ask how to make an object ex. an arrow turn into direction of the mouse?ENTER_FRAME and some mathematical functions, but I cant tell which and how to use them.
View 2 RepliesI'm having a problem when detecting the direction of the mouse.I'm using the following script:
Code:
stop();
//
[code].......
I don`t want any text really, just all my photos. So I was thinking about having a full screen page with photos about 400 - 500 px wide and have them all scattered around the page.And when the mouse moved farther to the top of the page it would scroll up in the flash movie showing more photos. and same with any direction. I suppose I don`t want an "infinate menu" becuase I want it to end when there`s no more photos on the side your looking at
View 3 Replies