Be a Supporter!

As3: Main

  • 76,738 Views
  • 168 Replies
New Topic
Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to As3: Main May. 5th, 2007 @ 04:30 AM

Cool stuff, got a reasonable collection of tuts already. At the moment, while the list is short, I'm not gonna be fussy about which to include - however, as the list grows, some pruning may take place. For now, though, hopefully this will make the learning process a little easier. Keep 'em coming, and once again thanks to the contributers.

AS3 TUTORIALS

AttachMovie via Class ID by Alphabit
Changing Framerate by Siggles
Custom Cursor by Jindo
Events by LesPaulPlayer
Global Buttons by ninjitsuwarrior
hitTests by Jindo
Key Input (AS2 Style) by dELtaluca
OOP by Alphabit
Pointing at Mouse by trig1
Rotate And Shoot To Mouse by Pyromaniac
Springs by trig1
Timer

OTHER USEFUL LINKS

AS3 Overview
Getting Started with AS3
Senocular's AS3 Tip of the Day
AS3 Cookbook Chapters as pdf
Flashscript.biz tuts
FlashWiki
AM Laboratories

AS3 (Flex) Language Specs
AS2.0 Migration
Actionscript Cheatsheet


- - Flash - Music - Images - -

BBS Signature
TrueDarkness
TrueDarkness
  • Member since: Aug. 31, 2004
  • Offline.
Forum Stats
Member
Level 27
Blank Slate
Response to As3: Main May. 5th, 2007 @ 11:25 AM

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);
}

RyanPridgeon
RyanPridgeon
  • Member since: Dec. 7, 2005
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to As3: Main May. 5th, 2007 @ 11:38 AM

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);


I make flashes because I can.
PM me for anything flash or web related or visit my blog!!

BBS Signature
Pyromaniac
Pyromaniac
  • Member since: Jan. 14, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to As3: Main May. 5th, 2007 @ 02:37 PM

At 5/5/07 11:25 AM, TrueDarkness wrote: I'm interested in a tutorial that teaches you how to move an object with the arrow keys.

// What your looking for is keyC ode, and we use event.target to refer to what calls the event

var speed:int = 5;
var box:Sprite = new Sprite;
with (box.graphics) {
lineStyle(1, 0x000000, 100);
lineTo(0,10);
lineTo(10,10);
lineTo(10,0);
lineTo(0,0);
}

addChild(box);
box.x=250, box.y=200;

function checkKey(event:KeyboardEvent):void {
if (event.keyCode == 39) {
box.x+=speed;
}
if (event.keyCode == 37) {
box.x-=speed;
}
if (event.keyCode == 40) {
box.y+=speed;
}
if (event.keyCode == 38) {
box.y-=speed;
}
}
stage.addEventListener(KeyboardEvent.KEY_DOWN , checkKey);

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to As3: Main May. 5th, 2007 @ 03:43 PM

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
LesPaulPlayer
LesPaulPlayer
  • Member since: May. 18, 2006
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to As3: Main May. 6th, 2007 @ 03:26 PM

AS3: Quality

LesPaulPlayer
LesPaulPlayer
  • Member since: May. 18, 2006
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to As3: Main May. 6th, 2007 @ 04:10 PM

AS3: old fashioned random function

hashbrown
hashbrown
  • Member since: Jul. 7, 2005
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to As3: Main May. 9th, 2007 @ 12:18 AM

stuff advanced ppl dont need to know


BBS Signature
Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to As3: Main May. 10th, 2007 @ 06:08 PM

AS3: Simple Preloader


- - Flash - Music - Images - -

BBS Signature
Pingo-Five
Pingo-Five
  • Member since: Nov. 9, 2005
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
phyconinja
phyconinja
  • Member since: Sep. 18, 2004
  • Offline.
Forum Stats
Member
Level 25
Blank Slate
Response to As3: Main May. 11th, 2007 @ 05:42 PM

AS3: API. Shapes

ShooterMG
ShooterMG
  • Member since: Nov. 10, 2006
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to As3: Main May. 11th, 2007 @ 08:11 PM

As3: Display List & Swapping Depths

TrueDarkness
TrueDarkness
  • Member since: Aug. 31, 2004
  • Offline.
Forum Stats
Member
Level 27
Blank Slate
Response to As3: Main May. 12th, 2007 @ 12:47 PM

AS3: Movement with Keys

trig1
trig1
  • Member since: Oct. 4, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to As3: Main May. 12th, 2007 @ 03:11 PM

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.

jesseRYU
jesseRYU
  • Member since: Feb. 17, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to As3: Main May. 12th, 2007 @ 03:30 PM

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


New at flash then get some help.

BBS Signature
phyconinja
phyconinja
  • Member since: Sep. 18, 2004
  • Offline.
Forum Stats
Member
Level 25
Blank Slate
Response to As3: Main May. 12th, 2007 @ 03:41 PM

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.

jesseRYU
jesseRYU
  • Member since: Feb. 17, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to As3: Main May. 12th, 2007 @ 03:42 PM

yehh my bad i noticed it 5 mins after i posted


New at flash then get some help.

BBS Signature
Depredation
Depredation
  • Member since: Sep. 5, 2005
  • Offline.
Forum Stats
Member
Level 17
Game Developer
Response to As3: Main May. 13th, 2007 @ 02:29 PM

Flash CS3 Review/Overview

Could it be added to extras please :D.

BBS Signature
PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to As3: Main May. 14th, 2007 @ 01:46 PM

I'd like to see a displacement filter tutorial.


BBS Signature
GustTheASGuy
GustTheASGuy
  • Member since: Nov. 2, 2005
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to As3: Main May. 14th, 2007 @ 02:01 PM

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
PrettyMuchBryce
PrettyMuchBryce
  • Member since: Mar. 17, 2001
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to As3: Main May. 14th, 2007 @ 02:05 PM

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.


BBS Signature
Rammer
Rammer
  • Member since: Jun. 8, 2003
  • Offline.
Forum Stats
Member
Level 33
Programmer
Response to As3: Main May. 14th, 2007 @ 06:28 PM

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

Blommestein
Blommestein
  • Member since: Nov. 7, 2006
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to As3: Main May. 14th, 2007 @ 07:49 PM

Useful AS3 tutorial: http://www.metah.ch/as3/video/displayListVide o.swf

Source Files: http://www.metah.ch/as3/sources/as3_0_2_displ ayList.zip

Naois
Naois
  • Member since: Oct. 31, 2005
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to As3: Main May. 15th, 2007 @ 04:16 PM

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.

Battered-Prawn
Battered-Prawn
  • Member since: Aug. 2, 2006
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to As3: Main May. 19th, 2007 @ 06:13 AM

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
3dwarrior
3dwarrior
  • Member since: Nov. 3, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to As3: Main May. 19th, 2007 @ 03:04 PM

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
Naois
Naois
  • Member since: Oct. 31, 2005
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to As3: Main May. 22nd, 2007 @ 09:29 PM

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.

shazwoogle
shazwoogle
  • Member since: Sep. 27, 2004
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to As3: Main May. 25th, 2007 @ 02:35 AM

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

Skeik-Sprite
Skeik-Sprite
  • Member since: Jun. 19, 2005
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to As3: Main Jun. 6th, 2007 @ 01:24 AM

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.

3dwarrior
3dwarrior
  • Member since: Nov. 3, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to As3: Main Jun. 6th, 2007 @ 02:11 AM

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