Diagonal HitTest/bounce
hiya,
im building an interface which is essentially a ball bouncing around inside a trapezoidish shape, .........________ .........|......| ......../....../ ......./....../ ......|______| - more or less, all 90 or 45 degree angles. do you know how to make it so the ball can bounce off a diagonal wall? the problem i am having is that the hitTest works off the rectangle created by the farthest edges of the object, since the diagonal walls run at 45 degrees, would there be a way to calculate a triangular half and use that for the hitTest?
thanks
G
ThX
li'l green dude
FlashKit > Flash Help > Flash ActionScript
Posted on: 07-20-2001, 07:36 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Diagonal HitTest
hiya,
im building an interface which is essentially a ball bouncing around in a trapezoidish shape, all the angles are either 90 or 45. the normal hitTest wont work because it calculates on the rectange of space surrounding the graphic. i have seen this done with some kind of vectors, but i have no experience with those ...yet
ThX
li'l green dude
Diagonal HitTest (again)
hiya,
im building an interface which is essentially a ball bouncing around inside a trapezoidish shape,
........________
........|......|
........|......|
......./....../
....../______/
- more or less, all 90 or 45 degree angles. do you know how to make it so the ball can bounce off a diagonal wall? the problem i am having is that the hitTest works off the rectangle created by the farthest edges of the object, since the diagonal walls run at 45 degrees, would there be a way to calculate a triangular half and use that for the hitTest?
someone sent me this link, but it's too abstract for me to conceptualize how to get what i need out of it
-=help mi plz, i have ants coming out of my keyboard=-
thanks
G
ThX
li'l green dude
Hittest Diagonal
Hello guys,
I'm busy now with a game now. I'm having problems with the hittest. I found a nice tutorial on flashfocus.nl. Maybe the dutch people know the site...But anyway, I had to move my charachter on a perspective way as you can see i the code or fla:
var heroW = 10;
var heroH = 20;
//var velY = 0;
//var stepS = 8;
var stepX = 8;
var stepY = 4;
//var jumping = true;
var grondY = 380;
this.onEnterFrame = function() {
if (Key.isDown(Key.UP)) {
for (var i = 0; i<stepX; i++) {
hero._x--;
}
for (var j = 0; j<stepY; j++) {
hero._y--;
}
}
if (Key.isDown(Key.DOWN)) {
for (var i = 0; i<stepX; i++) {
hero._x++;
}
for (var j = 0; j<stepY; j++) {
hero._y++;
}
}
if (Key.isDown(Key.LEFT)) {
for (var i = 0; i<stepX; i++) {
hero._x--;
}
for (var j = 0; j<stepY; j++) {
hero._y++;
}
}
if (Key.isDown(Key.RIGHT)) {
for (var i = 0; i<stepX; i++) {
hero._x++;
}
for (var j = 0; j<stepY; j++) {
hero._y--;
}
}
};
And then i saw the hittest code for regular movements see below for the left:
if (Key.isDown(Key.LEFT)) {
for (var i = 0; i<stepX; i++) {
hero._x--;
for (var j = 0; j<=heroH; j++) {
if (ground.hitTest(hero._x-heroW, hero._y-j, true)) {
i = stepX;
j = heroH+1;
hero._x++;
}
}
}
}
But for somehow i cant fix the hittest in my code. Can someone help me?
HitTest With Diagonal Lines
i am creating a flash game and i can stop the caharacter from crossing lines but when i use diagonal lines, the character stops at the blue box seounding it.
i thought it would work but i need to know how to shrink the blue box that is created when you make a movie clip.
please help
----------CODE------------------------
onClipEvent (load) {
this._visible = false;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root["stanD"])) {
_root["stanD"]._y -= _global.speed;
_root["stanD"]._x += _global.speed;
}
if (this.hitTest(_root["blob"])) {
_root["blob"]._y -= _global.moveSpeed2;
_root["blob"]._x += _global.moveSpeed2;
}
if (this.hitTest(_root["gEnemy"])) {
_root["genemy"]._y -= _global.gEnemySpeed;
_root["genemy"]._x += _global.gEnemySpeed;
}
}
How Can I HitTest A Diagonal Line (Not The Square Surrounding It)
I'd given up on this for a while but it keeps coming back to me. If anyone can help me out with a simple method, an extremely complicated method, or just tell me if i'm wasting my time please let me know.
To fill you in if your not sure what I mean, if you draw a diagonal line from co-ords (0,0) to (10,10) and convert it to a movie clip and drop another movie clip (a (1,1) pixel) downwards from a y co-ord above this (eg -5) and a x co-ord of 5.
If you have a hitTest operating between the two clips and the second clip keeps dropping at 1 co-ord a frame, the hitTest will activate when the second clip is at co-ord (5,0) even though the line I've drawns y co-ord at 5x is also 5.
Sorry if i've confused you more by my explanation than you were before, but if you can help me out here I'd really appreciate it/
HitTest - Bounce Direction
I'll begin by posting a link to the swf in question. Steer using WASD keys, and don't mind the bouncing at the start, just steer out of the box into the open.
http://img144.imageshack.us/my.php?i...ncehelpar6.swf
You will notice that if you hit any of the walls of the flash, the ball will bounce off the wall. (unnaturaly, but I'm very content with this way).
You will also notice that you can bounce off the top and the bottom of the flash, as well as the black rectangle's sides.
Now to the problem: Try bouncing off the bottom of the black rectangle. The ball will go "inside" the rectangle and be thrown off to one of the sides instead of bouncing down like it should.
If you try standing completely still (no left or right movement) under the rectangle and go upwards it will bounce like it should.
PHP Code:
onClipEvent (load) { touching = false;}onClipEvent (enterFrame) { if (this.hitTest(_root.ball) && touching == false) { trace(touching); if (_root.ball.xdest>_root.ball._x && touching == false) { _root.ball.xdest -= 150; } else if (_root.ball.xdest<_root.ball._x && touching == false) { _root.ball.xdest += 150; } else if (_root.ball.ydest<_root.ball._y && touching == false) { _root.ball.ydest += 150; } else if (_root.ball.ydest>_root.ball._y && touching == false) { _root.ball.ydest -= 150; } touching = true; trace(touching); } if (!this.hitTest(_root.ball)) { touching = false; }}
(yes, I'm a n00b at flash and actionscript as you can see by the very bad coding)
I know why this problem occurs, or at least I think I do. The left and right directions take "priority" over the up and down directions thanks to the way the 'else ifs' are positioned. Flash basicly says "aha the ball is moving to the left or right, bounce it in the oppisite direction" and ignores if it is going up or down.
So I know what causes the problem, but I got no clue how to redeem it. Help?
Drop, Bounce, Collide, Bounce?
Hi!
I'm trying to figure out how to get 2 (or more) movie clips to bounce off each other and it's a bit frustrating since I'm just learning HitTest etc.
What I have:
- I have 2 movie clips, a circle and a square.
- each movie clip has actionscript for the "falling" gravity to work.
- each movie clip has a button in it with actionscript for the dragging and releasing etc.
- When the movie loads, the circle and square drop from the top of the stage and bounce (using gravity etc).
- You can drag and "toss" each object and it will bounce off the sides and bottom of the stage.
What I'm trying to do:
1) I'd like the circle and square to bounce off each other when they collide just like they bounce off the sides of the stage (right now they bounce behind or in front of eachother based on their layer depths).
2) Also, but less important, I'd like them to bounce off the top of the stage too instead of flying up and out.
Questions:
- How do I make this work? I've seen many examples using HitTest etc on instances of one movieclip, but my movie clips need to be different since they will be turned into separate objects/graphics later (if that makes sense). Is this still a HitTest solution? I don't think so since I'm not really using HitTest to begin with? I've tried incorporating code from some of those examples, but it just doesn't work.
I've attached 2 files - one in Flash 8 format, and another in Flash mx2004 format so hopefully someone can open one of them, take a look at the code and give me some help.
I appreciate it
Peace,
Hondo311
Movie Bounce In Bounce Out
Hi
I want to make a menu that bounces in on key press (for ipaq ppc)and when pressed again with the stylus bounces back out. I am using Flash MX but can not get this to work. Any ideas gretefully received.
Thanks
Bounce, Collide, Bounce Again?
Hi!
Flash 8 Actionscript question:
I'm trying to figure out how to get 2 (or more) movie clips to bounce off each other and it's a bit frustrating since I'm just learning HitTest etc.
What I have:
- I have 2 movie clips, a circle and a square.
- each movie clip has actionscript for the "falling" gravity to work.
- each movie clip has a button in it with actionscript for the dragging and releasing etc.
- When the movie loads, the circle and square drop from the top of the stage and bounce (using gravity etc).
- You can drag and "throw each" object and it will bounce off the sides and bottom of the stage.
What I'm trying to do:
1) I'd like the circle and square to bounce off each other when they collide just like they bounce off the sides of the stage (right now they bounce behind or in front of eachother based on their layer depths).
2) Also, but less important, I'd like them to bounce off the top of the stage too instead of flying up and out.
Questions:
- How do I make this work? I've seen many examples using HitTest etc on instances of one movieclip, but my movie clips need to be different since they will be turned into separate objects/graphics later (if that makes sense). Is this still a HitTest solution? I don't think so since I'm not really using HitTest to begin with? I've tried incorporating code from some of those examples, but it just doesn't work.
I've attached 2 files - one in Flash 8 format, and another in Flash mx2004 format so hopefully someone can open one of them, take a look at the code and give me some help.
I appreciate it
Peace,
Hondo311
How Do I Go Diagonal?
Hello!
I'm using Flash 4 to write a top-down driving game, all the tutorials i've found have enabled me to control the vehicle on the keyboard, but only one button at a time, so forward, then turn, then forward.
Is there anyway of turning the vehicle while keeping it moving forward?
I know the Flash 5 has it all sewn up, so what about Flash 4?
Many thanks in advance
Diagonal Movement
Hi everyone,
what i'm trying to do is move an object (spaceship mc) from random off stage positions accrss the stage at different times (not trigered by key press). The movement of the spaceship is to be in diagonal paths.
For the off stage random positioning I don't have a clue! I'm thinking of maybe storing start and end positions in an array (so not using random).
For the angle of movement I obviously need to use sin and cos to determine the movement. Any help implimenting this would be really helpful, as i'm not that good with trig in Flash just yet.
hope you can help
Thanks
Diagonal Lines...I....Just....Can't....Do IT
Ok, this has been annoying me for a while and i'm coming to the point in my design process where i'm going to HAVE to get this done, but still have not figured it out.
It's how to get diagonal lines in graphics...in Flash...that are clean and not "jaggy".
I just can't figure it out in Flash and in Photoshop i've done everything from skewing a rectangle to using the grid to draw a perfect path & then highlighting the path and copying the image to a PNG file.
Regardless, the diagonals are "jaggy" or not perfectly straight...or both.
Here's an example I found of someone who IS able to do it:
http://www.flashkit.com/gallery/Inte...60/index.shtml
Can anyone here break my thick mental block on what seems to me, something that should be a simple procedure?
Diagonal Movement
Hello,
With actionscript how can I move a movie clip from one position, Diagonally to a another position and then stop?
Diagonal Guides How The ......?
well that's it
i just don't know how to do it!
Can anyone pleeeeeease tell me how can i make the guides diagonal, or in any other position than vertical or horizontal?
10x
Diagonal Text Box
HI,
I have a text field I'd like to follow my design, so it would be some sort of trapeze (one side would be a diagonal). I can stretch the box the way I'd like it, usign arrow+command but it doesn't stay like that when I release the mouse.
Is there any way to do this?
Thanx
Diagonal Movement
hey,
i have a "gun" following the mouse... and when you click, a bullet appears and goes towards the mouse...
here is my code for the following of the mouse...
Code:
angle2 = Math.round(angle/Math.PI*180);
angle = Math.atan2(opp, adj);
opp = ((_root.guy._ymouse-this._y));
adj = -1*(_root.guy._xmouse-this._x);
this._rotation = -1*angle2;
then... i want the bullet to move towards the mouse... so i added this code...
Code:
_root.bullet._y += (oop);
_root.bullet._x += (adj);
and that works fine... but the problem is that when the mouse is farther away, the bullet goes faster... and when its close it goes slower...
so i tried another code...
Code:
_root.bullets._x += 1;
_root.bullets._y -= (oop/adj);
but now... the bullet move faster and slower depending on the angle the gun is at...
so is there a way to get it to move at a steady speed no matter what?
[F8] Diagonal Movement
I realise this is probably as easy as but I haven't found any info on it yet. I have a movie clip that I can move in four directions (up, down etc. using Key.isDown(Key.UP)). I am now trying to get it to move in a diagonal when two buttons are pressed eg UP and RIGHT. Is this possible, if so how? If not what do I do?
Cheers,
Pete
[MX] Diagonal Shooting
Does anyone know how to make shots fire towards the mouse?
Also, does anyone know how to make something turn towards the mouse as well?
I'm hoping to use it for a shooter game (top-down), but im not good with trigonometry and all that fancy stuff
Diagonal Txt Box Problems
I have just tried to use a txt(dynamic or static) box, then make it diagonal on the page - this stopped the text being shown when exported, when i changed it back to horizontal it worked fine, anyone know why this happens and or how to stop it.
Thanks, Phil
Diagonal Movment
I'm having a problem getting my wee man to move diagonal.
at the momet on the map MC I have the following code:
Code:
onClipEvent (load) {
sSpeed = 15;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x -= sSpeed;
} else if (Key.isDown(Key.UP)) {
this._y += sSpeed;
} else if (Key.isDown(Key.DOWN)) {
this._y -= sSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x += sSpeed;
}
}
Is simple to get it to move left, right, up or down, but how do I got it to move at an angle, say a player presses both left and down, or up and right, how do I reflect this?
Diagonal Animation With AS
I am having a hard time to get this shape to animate diagonal. I have a MC that is 30 wide by 500 high. I rotated that on the stage by 45 degrees. I now want that to become wider in my animation, so the side that is 30 wide, because way wider. I tried this, making both width and height 500, but it barely changes in size.
fOpenWork.push([{target:mask_0, _width:500, time:OpenTime1, delay:1, ease:"easeOutExpo"},
{target:mask_0, _height:500, time:OpenTime1, delay:1, ease:"easeOutExpo"}
]);
My registration point of the MC seems to be on the right side for what I think I am trying to do. How would I need to set his up to get it to work? Would I use a different shape?
Diagonal Scrolling?
Is it possible to modify this tutorial:
http://www.kirupa.com/developer/flash5/slidingmenu.htm
to enable the buttons to scroll to a mc if the clipgeneral mc was organized like this:
OO
OO
rather than like this:
OOOO
so instead of just scrolling sidways, it would be possible to scroll both vertical and diagonaly accordingly?
Thanks.
chop.
Diagonal Lines
Hello,
Why is it that a diaganal black line in flash actually looks greyish in the movie?
More importantly, is there a way to fix this?
thanx.
Diagonal Scroller
Well, I wouldnt have a clue where to start in developing a diagonal scroller from scratch. So I wondering if anybody knows of any that I can download?
I've had a good search, and by the looks of it, a scroller that diagonaly scrolls text or mc's doesnt seem possible.
Cheers
Diagonal Scrolling?
Is it possible to modify this tutorial:
http://www.kirupa.com/developer/flash5/slidingmenu.htm
to enable the buttons to scroll to a mc if the clipgeneral mc was organized like this:
OO
OO
rather than like this:
OOOO
so instead of just scrolling sidways, it would be possible to scroll both vertical and diagonaly accordingly?
Thanks.
chop.
Diagonal Lines
Hello,
Why is it that a diaganal black line in flash actually looks greyish in the movie?
More importantly, is there a way to fix this?
thanx.
AS3 - Diagonal Movement
Hello, I was wondering if anyone could help me with some diagonal AS3 movement. Here is the code I'm using:
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, movePlayer);
function movePlayer(event:KeyboardEvent):void{
if(event.keyCode == Keyboard.LEFT){
player.x -= 3;
}
if(event.keyCode == Keyboard.RIGHT){
player.x +=3;
}
if(event.keyCode == Keyboard.UP){
player.y -= 3;
}
if(event.keyCode == Keyboard.DOWN){
player.y += 3;
}
}
It works great, except for the fact that I cannot get the player to move diagonally. Also, when I press down one of the arrow keys, the player moves in that direction three pixels (just like it should), then briefly pauses, then continues to move in that direction. How can I make it so that the player can move diagonally by holding two of the arrow keys at the same time and that the player steadily moves in the correct direction, without pauses after the first three pixels moved?
By the way, I know that I can make the player move diagonally by testing to see if right and up are held, left and up, right and down, and left and down, but then I will need to use four more if statements. Is there a way to do this without those excessive if's?
Diagonal 3d Carousel
hi there,
im quite new to this site and omg its awesome.
im wondering why i never noticed it.
since im into animation im not pretty new to flash, but im really new to this whole actionscript animation stuff.
at the company i work for now, im faced with the completion of some jobs which are quite new to me. so i got to figure this out.
im also not totally new to coding as its nothing new today. every package nearly comes with some scripting language and im pretty proud for an action script beginner to understand nearly the whole code of the '3d carousel' project cheers to me.
hey, i find it quite awesome for me .
thing which is buggin me is - how to get this carousel flow diagonally ? the more i think about it, the more i believe this would be a quite different application but i´m not really sure about this. i tried to mess around with the sin&cos but all i acomplished was to nearly crash my system
i mean not really cycling this complete thingie 27degrees or so - i mean letting them flow from the upper right corner to the lower left for instance. the pictures should remain horizontally(is there a word like this?)
i ordered the animation book lee mentioned on amazon today but this will take some while to arrive grrr. and for the beginning i bought the flash math creativity book from friendsofed which cost me over 40 euros but there is not a lot explained. mostle chunks of code to figure it out by yourselfe. i mean its a great book but i don´t want to copy anything for a great effect and im to busy to take the code and learn from it at the moment. <yeah spammers are welcome to flame me>
this 3d carousel would fit perfectly for a job im working on at the moment but only if i get it to spin diagonally.
sorry for my bad english ^^
would be awesom if you could help me out!
Diagonal Lines - Please Help
Hi.
I am using Fireworks MX and I am naving probs creating a
diaonal line that is easy on the eyes. THe lines are too
pixely and the blur and shadow effects only seem to make
it more messy. I want a fluid diagonal line that has no
hint of pixels when viewed online. Could somebody show
me how to skillfully do this, possibly by drawing a box with
diaonal heights (and shadows on the right side)? Here is a
lame-duck version of what i am trying to accomplish (the inside
lines are for formatting):
_____
/____/
/____/
/____/
/____/ <-- shadow on right
^
|
shadow below
I'd really appreciate some design guru direction here - i
am a programmer, not a designer.
Thanks!
Smooth Diagonal Scrolling
Ok, I got a movie clip that scrolls diagonally. Inside the movie i'm using the script:
setProperty (this, _x, getProperty(this, _x) - .3);
setProperty (this, _y, getProperty(this, _y) - .3);
it works, but it's really shaky. It looks like its climbing stairs.. it goes left then up then left then up, and i wont it to move diagonally instead of climb. Any ideas?
Thanks
Charlie
Diagonal Slider Flash Mx
How can I create a diagonal slider (line with draggable button on it)without creating a vertical or horizontal movie clip and rotating it? i need to get coordinates of the button and the rotation makes the math really complicated.
Any ideas? can i use a guide layer somehow to constrain a draggable button to a diagonal?
Thanks!
Simple Diagonal AC Movement- - -help Please
I'm having great difficulties making a movieclip move onmouseover. I need to do this in AC as opposed to tweens to cut down on the file size. My scenario:
I have a movieclip at the bottom right corner of the movie (nearly all of the movieclip is outside of the stage) When the mouse is passed over the partial movieclip still on the stage, it will move onto the stage entirely, and when the mouse moves off, it moves back to the original position.
Sorry for the long winded explanation. I'm guessing this would deal with easing? This is why i'm not sure on what to do, i'm fairly new when it comes to dealing with the mouse movements and movieclips combined. ANY help at all would be excellent. Take care.
Victor.
Diagonal Fade Transition Help
<!-- This element has the filter applied. -->
Hello,
I want to achieve diagonal fade transition between movie clips in flash. Something similar to what i want to do is in the following DHTML code. Any help of achieving this diagonal fade transition would be great.
Thank you
html file
<DIV ID="oTransContainer" STYLE="position:absolute; top: 0px; left: 0px; width: 300px;
height:300px; filterrogidXImageTransform.Microsoft.Strips(Du ration=5, Motion='leftdown') ">
<!-- This is the first content that is displayed. -->
<DIV ID="oDIV1" STYLE="position:absolute; top:50px; left:10px; width:240px; height:160px;
background:gold"> This is DIV #1 </DIV>
<!-- This content displays after the first content. -->
<DIV ID="oDIV2" STYLE="visibility:hidden; position:absolute; top:50px; left:10px;
width:240px; height:160px; background: yellowgreen; "> <BR> This is DIV #2
</DIV>
</DIV>
<BUTTON onclick="fnToggle()">Toggle Transition</BUTTON>
<SCRIPT>
var bTranState = 0;
function fnToggle() {
oTransContainer.filters[0].Apply();
if (bTranState=='0') {
bTranState = 1;
oDIV2.style.visibility="visible";
oDIV1.style.visibility="hidden";}
else {
bTranState = 0;
oDIV2.style.visibility="hidden";
oDIV1.style.visibility="visible";}
oTransContainer.filters[0].Play();}
</SCRIPT>
Diagonal Line Animation
I'm currently looking to create a diagonal line animation within Flash MX.
I've thrown together a really quick example (attached) using a JPEG with motion tween, but I'm really interested in creating this effect within Flash instead of having to import an existing image. Is this possible?
Many thanks,
Ricoz.
[cs3] Help With Diagonal Scrolling Text?
ok, this isn't making any sense to me...
check out this flash file, here
these are the exact same movie clips, only two different instances.
one is straight, the other set on a diagonal. as you can see, the diagonal doesn't work. it scrolls fine, but the text doesn't show up in the mc.
does anyone have any idea why this isn't working?
i'm stuck.
Diagonal Scrolling Text?
ok, this isn't making any sense to me...
check out this flash file, here
these are the exact same movie clips, only two different instances.
one is straight, the other set on a diagonal. as you can see, the diagonal doesn't work. it scrolls fine, but the text doesn't show up in the mc.
does anyone have any idea why this isn't working?
i'm stuck.
Diagonal Video Scrubber
Diagonal video scrubber
I have a video scrubber that controls an flv file. What I want to do is make it so the scrubber in on a diagonal line to simulate a 3d environment. Does anyone know of a good way to confine a movie clip on a diagonal path?
Thanks.
Diagonal SeekBar Component
I have placed a seekbar component and rotated it diagonally on the stage. The problem is that the seekbar handle no longer follows the bar when the FLV is playing. How can I script the seekbar's _y axis to follow the path of the seekbar? I have been searching for an answer for this question for a long time...any help would be greatly appreciated!
Here is an image of the situation: Image
Resizing A Diagonal Line
I have a line that is on an angle of 15.3 degs which i want to be the width of the stage - in case the stage/browser is resized.
I want the thickness and angle of the line to stay the same.
I have a stageListener to execute the onResize which works.
I have tried 3 methods within the function command, but they all have problems.
line._width = Stage.width;
- the angle changes depending on the size of the stage
line._width = Stage.width;
line._yscale = preloader._xscale;
- the line gets thicker as it gets longer
line._x = 0;
line._width = Stage.width * 1.05;
line._rotation = 15.3;
- with this method I start the line on the stage at 0degs which is then resized and rotated, however the thickness of the line still increases as the line gets longer.
Any ideas?
Cheers
Barton
Diagonal Text Swipes?
I am curious as to how people do text swipes in Flash? What I mean is, you know when the text swipes, say, from the top left to bottom right in a diagonal fashion? Do you have some sort of mask over the box or something and animate that quickly?
Thanks
Diagonal Keyboard Movement
I'm trying to get the characters in this Flash game to move diagonally - it works, but the following occurs:The character is walking twice as fast as it does when going left, right, up, down
The walking animation doesn't play
PHP Code:
onClipEvent (load) {walkSpeed = 3;stop();}onClipEvent (enterFrame) {if (Key.isDown(key.DOWN)) {_y += walkSpeed;this.gotoAndStop(1);}if (Key.isDown(Key.UP)) {_y -= walkSpeed;this.gotoAndStop(2);}if (Key.isDown(key.LEFT)) {_x -= walkSpeed;this.gotoAndStop(3);}if (Key.isDown(key.RIGHT)) {_x += walkSpeed;this.gotoAndStop(4);}if (Key.isDown(Key.LEFT) & Key.isDown(Key.UP)) {this.gotoAndStop(5);_x -= walkSpeed;}if (Key.isDown(Key.RIGHT) & Key.isDown(Key.UP)) {this.gotoAndStop(6);_x += walkSpeed;}if (Key.isDown(Key.DOWN) & Key.isDown(Key.LEFT)) {this.gotoAndStop(7);_x -= walkSpeed;}if (Key.isDown(Key.DOWN) & Key.isDown(Key.RIGHT)) {this.gotoAndStop(8);_x += walkSpeed;}if (!Key.isDown(key.UP) & !Key.isDown(key.DOWN) & !Key.isDown(key.LEFT) & !Key.isDown(key.RIGHT)) {this.gotoAndStop(9);}}
Can someone show me the way?
Diagonal ScanLines - Da Mystery
Ever since I touched Flash I've always wondered. How is it that people create those diagonal scanlines so perfectly spaced out? I know it's possible in Photoshop and I also know it's possible in Flash! Take a look at diasin.com or 2advanced.com...how the hell is that done?:
Thick Diagonal Scanlines
hey,
what I am wanting to do it have the normal diagonal scanlines, but instead on the line being 1 px thinck, be say 100 px think, and i cant seem to get it, ne help?
thanks
Diagonal Movement. PLZZ Help
Sup people, im trying to make an object move in a diagonal direction, when i click on a button.prefferably moves down and to the left, my code is all screwed up and i cant see straight anymore, so thanks for any help!
this is the code i have on my button
ActionScript Code:
on (release) {
_root.object.pos = 100;
_root.object = pos-_y;
}
onClipEvent (load) {
_y += y/speed;
_x += x/speed;
}
this is the action on the object...as is, its moving to a location were it will be moved from
ActionScript Code:
onClipEvent (load) {
speed = 5;
pos = -100;
}
onClipEvent (enterFrame) {
y = pos-_y;
_y += y/speed;
}
onClipEvent (load) {
speed = 5;
pos = 200;
}
onClipEvent (enterFrame) {
x = pos-_x;
_x += x/speed;
}
i know it looks terrible
Got The Straight Line Working = Need A Diagonal
Yeah the straight line is working great...Thanks for the assist...
Diagonal line is still a mystery.
But some ideas i had was attaching the clip to a motion guide layer ... drawing a path ...
Doesn't work though...
Why does it have to be so hard!!!!!
You would think that you could do this rather easily.
|