00:00
00:00
Newgrounds Background Image Theme

Wetrinas just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

As3: Main

99,585 Views | 165 Replies
New Topic

Response to As3: Main 2007-05-05 11:25:06


I'm interested in a tutorial that teaches you how to move an object with the arrow keys. While delta's tutorial is fantastic, I'm not looking for ways to make it like AS2, I want to learn the actual methods used in order to make it work. I've got something like this so far, but I'm not sure how to assign specific keys yet:

stage.addEventListener(KeyboardEvent.KEY_DOWN ,downEF);
stage.addEventListener(KeyboardEvent.KEY_UP ,up);
function downEF(KeyboardEvent) {
stage.addEventListener(Event.ENTER_FRAME, down);
}
function down(Event){
obj.x+=2
}
function up(KeyboardEvent){
stage.removeEventListener(Event.ENTER_FRAME, down);
}

Response to As3: Main 2007-05-05 11:38:49


Why not use delta's thing?

Anyway, here's a thing i made to see what As3 was like

import flash.events.*;
import flash.display.*;
var moving:Number=0;
var speed:Number=4;
stage.addEventListener(KeyboardEvent.KEY_DOWN ,keyDownFunction);
function keyDownFunction(event:KeyboardEvent):void {
if (event.keyCode==39){
moving=1;
}else if (event.keyCode==37){
moving=-1;
}
}
stage.addEventListener(KeyboardEvent.KEY_UP ,keyUpFunction);
function keyUpFunction(event:KeyboardEvent):void {
moving=0;
}
function mainframe(event:Event):void{
if (asds.hitTestObject(wall)){
while (asds.hitTestObject(wall)){
asds.x-=1;
}
}
if (moving!=0){
asds.scaleX=moving
}
asds.x+=moving*speed;
}
addEventListener(Event.ENTER_FRAME, mainframe);

Response to As3: Main 2007-05-05 15:43:29


Guys, requests for tutorials are OK, but please try to keep from posting code snippets or discussing that in here. If you know the code to help out, then create a new AS3: Topic - even if you don't, you can still start the topic, share what you know, and ask others to fill out any gaps. The advantage of having separate threads for each subject is that people can post their own approaches to the problem, point out errors (politely), or simply enhance the topic starter's code.

That's not to say you should start a topic if you have only half-learnt something, you should at least be confident in the fact that your code will actually work :)

In terms of what tutorials to do (if you have free time and the urge to write a tut for AS3), feel free to have a look through the topics in AS: Main, and adapt those that AREN'T obvious, ie, where the AS3 code is virtually identical to the AS2 code.

I'll leave these posts for a bit but I'll be clearing them out before they pass the 7-day limit. Wanna try and keep this thread as compact as possible.

...wonder if we'll reach 50 pages before AS4 comes out.....? :D


- - Flash - Music - Images - -

BBS Signature

Response to As3: Main 2007-05-06 15:26:42


Response to As3: Main 2007-05-06 16:10:40


Response to As3: Main 2007-05-10 18:08:02



- - Flash - Music - Images - -

BBS Signature

Response to As3: Main 2007-05-11 16:29:59



.

BBS Signature

Response to As3: Main 2007-05-11 17:42:53


Response to As3: Main 2007-05-11 20:11:21


Response to As3: Main 2007-05-12 12:47:05


Response to As3: Main 2007-05-12 15:11:39


Would it be a good idea to link to tutorials that are in AS: Main, but work for as3 and 2. Things like arrays, or loops; otherwise it would take a long time rewriting things already made and working.

Response to As3: Main 2007-05-12 15:30:36


Does AS3 have the same basics from AS2 like the hitTests or is it completely different?


BBS Signature

Response to As3: Main 2007-05-12 15:41:11


At 5/12/07 03:30 PM, jesseRYU wrote: Does AS3 have the same basics from AS2 like the hitTests or is it completely different?

dude. theres a hitTest tut. read the list.

Response to As3: Main 2007-05-12 15:42:50


yehh my bad i noticed it 5 mins after i posted


BBS Signature

Response to As3: Main 2007-05-13 14:29:24


Flash CS3 Review/Overview

Could it be added to extras please :D.

BBS Signature

Response to As3: Main 2007-05-14 13:46:52


I'd like to see a displacement filter tutorial.

Response to As3: Main 2007-05-14 14:01:04


http://www.newgrounds.com/bbs/topic.php?id=70 1485
Could make one. But then again, it took me a whole two minutes to understand it and might require a whole page of words to qualify as a useful explanation for others.


BBS Signature

Response to As3: Main 2007-05-14 14:05:19


At 5/14/07 02:01 PM, GustTheASGuy wrote: Could make one. But then again, it took me a whole two minutes to understand it and might require a whole page of words to qualify as a useful explanation for others.

I'd really appreciate it. I am so confused as to how to even do a simple one. Its much more difficult than adding a more simple filter like glow or blur.

Response to As3: Main 2007-05-14 18:28:45


At 5/14/07 01:46 PM, PrettyMuchBryce wrote: I'd like to see a displacement filter tutorial.

i've wanted to see one for a while now ):

it's things like this and this that got me so insanely interested in the DisplacementMapFilter.


snyggys

Response to As3: Main 2007-05-14 19:49:58


Response to As3: Main 2007-05-15 16:16:37


This might be good for an "Other Useful Link": Learning AS3 with the Flex 2 SDK for Free
It's an article on how you can compile AS3 *.as files using Flex's SDK, while spending absolutely no money.

Response to As3: Main 2007-05-19 06:13:01


Ive looked everywhere, posted on the forum and looked here! now please can someone help me!

can you guys give me the AS3 (not AS2... or 1) to all of the movie control buttons. so far ive got the play button, now i need stop gotoframe onevent and stopall sounds.

pleasey please reply!!!


Why not send me a PM, or visit my User Page

BBS Signature

Response to As3: Main 2007-05-19 15:04:42


At 5/19/07 06:13 AM, Battered-Prawn wrote: can you guys give me the AS3 (not AS2... or 1) to all of the movie control buttons.

Look on the AS2 Migration Sheet, but I think someone needs to create a new tutorial as we don't want to teach people the old methods, as that can get confusing for new people and learning AS2 if you have no previous experience is a waste imo.


AS2 Main | AS3 Main | Flash Wiki There is no excuse for not trying to learn. Linux.

BBS Signature

Response to As3: Main 2007-05-22 21:29:12


At 5/5/07 04:30 AM, Denvish wrote: OTHER USEFUL LINKS
AS3 (Flex) Language Specs
AS2.0 Migration

These both point to the Flex 2.0 specs, and 2.01 now exists. You may want to either update them to AS3 (Flex 2.01) Language Specs and AS2.0 Migration (Flex 2.01) or add them below the current links.

Response to As3: Main 2007-05-25 02:35:27


[Link] Thers a very handy article I found, not sure if its already there but it helped me alot.

Response to As3: Main 2007-06-06 01:24:53


I dunno if anyone's covered it, but there really should be an array tutorial.

Programming with arrays make the addChild and removeChild things a lot easier, because you can just load the children in the array onto the stage and reference them individually from the array. I hope I'm not an idiot and the only person who hasn't figured this out.

I think I may write a tut on it tomorrow.

Response to As3: Main 2007-06-06 02:11:53


At 6/6/07 01:24 AM, Skeik-Sprite wrote: I dunno if anyone's covered it, but there really should be an array tutorial.

If you were to teach about arrays, then you would try to teach the underlying idea of the array and how to use it. I can't really figure out what would be the difference from the AS2 tutorials that teach you about arrays and one that you would create for AS3 aside from examples which might be useful to use specifically in AS3.

Then again, we still don't have a link in AS3:Main for arrays, and it would get rid of the dependence of the "starting to become old" AS:Main. So why not?


AS2 Main | AS3 Main | Flash Wiki There is no excuse for not trying to learn. Linux.

BBS Signature

Response to As3: Main 2007-06-06 17:37:12


Response to As3: Main 2007-06-07 22:07:04



"Give a man a match, and he'll be warm for a minute, but set him on fire, and he'll be warm for the rest of his life."

Response to As3: Main 2007-06-12 11:36:29


any news of a as3 vcam? or anywhere i could download one?


Why not send me a PM, or visit my User Page

BBS Signature