Home  | Login  | Register  | Help  | Play 

Flash Q&A Thread 4

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> Flash Q&A Thread 4
Page 1 of 3012345>»
Forum Login
Message << Older Topic   Newer Topic >>
8/8/2007 10:13:02   
The Illusive Man
Member






I restarted this thread because i found it an invaluable resource when I was starting out at flash. Seeing as LBB's got locked, I restarted it.

There are tutorial lists, and feel free to ask any questions you want. We'll try to help you.

If you use flash, post and get your name on the list.




Trials are availiable from - http://www.adobe.com/uk/products/flash/ ~ Don't download from anywhere else, the download may be corrupt.




Tutorials For AS2 -


Turn Based Battle System Tutorial - http://i5.photobucket.com/albums/y158/photo12/tutorialgame.swf

-----------

Chubbs' Hand Tutorial - http://i81.photobucket.com/albums/j231/chubbs153/handtut.swf

-----------

Sound - http://forums2.battleon.com/f/tm.asp?m=4121619&mpage=1&key=�

-----------

Movement - http://forums2.battleon.com/f/tm.asp?m=4121619&mpage=1&key=�

-----------

Buttons - http://forums2.battleon.com/f/tm.asp?m=4121619&mpage=1&key=�

-----------

Cursor and Cursor Effects - http://forums2.battleon.com/f/tm.asp?m=4121619&mpage=1&key=�

-----------

Tech Support with Flash Uploading - http://forums2.battleon.com/f/tm.asp?m=4121619&mpage=1&key=�

-----------

Text - http://forums2.battleon.com/f/tm.asp?m=4121619&mpage=1&key=�

-----------

Actionscript - http://forums2.battleon.com/f/tm.asp?m=4121619&mpage=1&key=�

-----------

Custom Effects - http://forums2.battleon.com/f/tm.asp?m=4121619&mpage=1&key=�




Personal Tutorial Threads -

Althorne's Flash Tutorials - http://forums2.battleon.com/f/tm.asp?m=10286250

If you have a tutorial, or tutorial thread please post the link and it will be added.







Key Contributers -

Althorne - Speciality ~ All Rounder (But Not Brilliant lol)
flsg - Speciallity ~ Actionscript2 - AS3
EragonZZZZ - Specialty ~ Actionscript 2.0, Animation and some Art

Flash Users (May Be Slightly Out of Date) -

-lil boi blue
-Zoltan
-Goten Maxwell (legend)
-imdark
-karn blood tooth
-codelabmaster
-independence quiad!!
-rich316
-gandalf5849
-Valgaera
-Jin
-Swenn
-petermaxo
-somebody621 - AS3
-SirSchmoopy




If you think I've missed anything, please tell me. Thanks to Lil Boi Blue for the major tutorials, as this used to be his thread.

-Althorne

< Message edited by althorne -- 9/21/2007 9:09:29 >


_____________________________

Post #: 1
8/8/2007 17:39:18   
EragonZZZZ
Member

You missed out a Flash user, possibly a major contributer.
Hate to sound conceited...but...

EragonZZZZ - Specialty ~ Actionscript 2.0, Animation and some Art
AQ  Post #: 2
8/8/2007 19:19:49   
flsg
Member

now that I re-look at those tutorials, I found the real problem of those who can't continue making their games anymore: althorne, lots of the tutorials are very fixed. When new users learn this, they think they became so great that they could start making games. This is why most people stop their game 1 month after

_____________________________

My flash gallery
my game thread

flsg, proud old member of AQ(still playing :O)
AQ  Post #: 3
8/8/2007 19:20:03   
petermaxo
Member

You also left me out of the flash users. As the first problem, left over from the third thread:

for some reason, this code won't work.

if (random(_global.block) <= random(_global.ebonus)){ //test for hit
_global.eattack = (_global.emin + random(_global.ebonus) - _global.defense) //set damage
disp_txt.text = _global.eattack //display damage
_global.ehealth -= _global.eattack //reduce health
}else{
disp_txt.text = "miss" //display miss
}

the damage is set, but health isn't reduced and I have suspisions that damage refuses to equal anything but 3.

I'd better explain the whole thing. for my battle system, I have 3 scenes- attack, defend, and battle. In battle, the enemy and you are just sitting there and all the buttons, health bar, etc. are shown. When you press the attack button, you go to the attack scene, and the health and buttons etc. vanish, leaving only you showing your attack animation and the enemie's 'hit' animation. Also, a dynamic text box displays the amount of damage done (_global.attack for your attacks, _global.eattack for enemy attacks.) when you get back to the battle scene, the health bar should show that health has been lost, but it hasn't shown that in any of my tests, and _global.attack and _global.eattack are always equal to three, and attacks always hit (although they are not supposed to).

Also, can someone explain how to include variables in the loadMovie function?
AQ DF  Post #: 4
8/8/2007 22:35:52   
EragonZZZZ
Member

Yeah, too many tutorials are just that, tutorials. They just give you step by step instructions to do something and you have to TRY to learn things.
Which isn't a bad thing, just
1) most people don't want to try hard when they just start out
2) you shouldn't have to really apply yourself immensely to a beginner lesson
AQ  Post #: 5
8/9/2007 3:29:47   
The Illusive Man
Member

I've updated the first post.

I get that flsg/eragon. And tutorials work if you just want a small thing quickly.




Petermaxo, is this for a turn based game?
Post #: 6
8/9/2007 15:00:09   
petermaxo
Member

yes, similar to AQ in the battle system.
AQ DF  Post #: 7
8/9/2007 17:27:58   
flsg
Member

althorne: yeah, the problem is that some person think that if they can follow the tutorial, they can build a game too XD
EragonZZZZ: are you learning AS 3?

P.S. put me in AS3 too althorne. thnx
AQ  Post #: 8
8/9/2007 23:23:37   
somebody621
Member

Put me in for collision detection/physics/as3, even though nobody here probably cares about those subjects, cause I come here a lot, just feel too lazy to post. If I see some question that spurs my interest, I'll answer. Not trying to brag, I've done a whole ton of AS3, so I can answer some questions on that too.

I might submit some code soon too... Probably will do the rectangle-rectangle SAT collision detection, and maybe circle-line sweep testing.

Edit: Heck, some code just for the fact it's a new thread. It's a vector class, used mostly for motion.

public class Vector
{
public var x:Number;
public var y:Number;
public function Vector(functionX:Number, functionY:Number):void
{
x = functionX;
y = functionY;
}
//get a copy of the vector
public function getCopy():Vector{
return new Vector(x, y);
}
//get the direction of the vector
public function getDir():Number{
return Math.atan2(y, x);
}
//get the length of the vector
public function getMag():Number{
return Math.sqrt(x * x + y * y);
}
//get the length squared
public function getMagSq():Number{
return x*x+y*y;
}
//add this vector with another
public function add (vector:Vector):void{
x += vector.x;
y += vector.y;
}
//return this vector added to another
public function addNew (vector:Vector):Vector{
return new Vector(vector.x + x, vector.y + y);
}
//subtract another vector from this
public function subtract (vector:Vector):void{
x -= vector.x;
y -= vector.y;
}
//return another vector subtracted from this
public function subtractNew (vector:Vector):Vector{
return new Vector(x - vector.x, y - vector.y);
}
//scale this vector by a number
public function multiply (scalar : Number):void{
x *= scalar;
y *= scalar;
}
//return this vector scaled by a number
public function multiplyNew (scalar : Number):Vector{
return new Vector(x*scalar, y*scalar);
}
//divide this vector by a scalar-effects the scale
public function divide (scalar : Number):void{
if(scalar == 0)
throw new Error("Cannot divide by zero");
x /= scalar;
y /= scalar;
}
//return this vector divided by a scalar
public function divideNew (scalar : Number):Vector{
if(scalar == 0)
throw new Error("Cannot divide by zero");
return new Vector(x/scalar, y/scalar);
}
//return the dotproduct of this vector and another
public function dotProduct(vector : Vector):Number{
return x * vector.x + y * vector.y;
}
//turn this into a unit vector, which is a vector with a length of one
public function normalize():void{
var vLen:Number = getMag();
if(vLen==0)
throw new Error("Vector cannot be normalized; It is a zero length Vector");
x /= vLen;
y /= vLen;
}
//return the unit vector of this
public function unit():Vector{
var vLen:Number = getMag();
if(vLen==0)
throw new Error("Vector cannot be normalized; It is a zero length Vector");
return new Vector(x/vLen, y/vLen);
}
//set the vector
public function setTo(xToSet:Number, yToSet:Number):void{
x = xToSet;
y = yToSet;
}
//multiply by a matrix
public function matrixMultiply(m:Matrix2D):void{
var tmpX:Number=x;
x=m.i1j1*x+m.i2j1*y;
y=m.i2j1*tmpX+m.i2j2*y;
}
//multiply by a matrix and return the vector;
public function matrixMultiplyNew(m:Matrix2D):Vector{
return new Vector(m.i1j1*x+m.i1j2*y, m.i2j1*x+m.i2j2*y);
}

public function getInv():Vector{
return multiplyNew(-1);
}

public function toString():String{
return ("("+x+", "+y+")");
}
}


< Message edited by somebody621 -- 8/9/2007 23:31:59 >
Post #: 9
8/10/2007 0:41:29   
Sephiroth12
Member

All of these tutorials work for Flash MX, right? Sorry I just now got it and I'm clueless
AQ  Post #: 10
8/10/2007 2:39:38   
The Illusive Man
Member

All AS2 tutorials work for Flash 5, Flash MX, Flash MX2004 and Flash 8
The AS3 tutorials (of which there are none) only work with the Flash 9 alpha (not availiable anymore) and flash CS3

flsg - added - and i thought like that once
Post #: 11
8/10/2007 9:40:05   
flsg
Member

somebody621: OMG, thank you, thank you!!! Finally, someone who really appreciate and write in AS3!!!
BTW, the x and y should be declared private, since there's no external use of it
and also, I think it's unsafe to use throw new error() without adding a try and catch statement directly inside the code. Often you'll forget to add those yourself when using the method externally, so the error might never be caught

also, the public class must be inside a package, and the toString function must be marked override: override public function toString()
plus, the toString method needs a String return type, like all the other toString functions. Or else it's an imcompatible override

< Message edited by flsg -- 8/10/2007 10:14:52 >
AQ  Post #: 12
8/10/2007 10:19:54   
somebody621
Member

Well, though it's less OOP, I find it much easier to directly modify the x and y when I need to directly change a vector's coordinates. I guess I could use the constructor again, I find direct access easier to work with when writing code. I thought a while about making them private, but I find it easier when x and y are public. Also, because you'll be likely to be defining your own package, I didn't put the package and stuff, but if you need it: package physics.math{ lol

For some reason, I'm not forced to do override. I think it might be a bug or something, because usually it catches me when I don't use override. After looking in some public source code, I also found that toString() often was not marked override.

< Message edited by somebody621 -- 8/10/2007 10:20:06 >
Post #: 13
8/10/2007 10:47:56   
swenn
Member

You know.. I think that you guys should give lessons.. trough a chat program.. it would help giving this forum better actionscripters :D ( I would be a student):D
AQ MQ  Post #: 14
8/10/2007 11:32:43   
SirSchmoopy
Banned Multi


in a side scroller, how wuld i make an enemy follow my character, but still hve to jump on platforms and everything, cuz everytime i try making them folow my character, they just fly right to him XD

_____________________________

Sig deleted.
Post sig only once per page.
Post #: 15
8/10/2007 19:50:02   
EragonZZZZ
Member

I beg to differ somedbody321 or whatever :]

I care about all of those things to the point where I'm writing an engine (albeit, in 2.0) that covers all of them and some more, too.
You seem to enjoy work with geometry and math-based things :D
Me not so much lol, but the love of OOP is the same

edit: and flsg, why does he need the try/catch?
it's a pretty straightforward error.

< Message edited by EragonZZZZ -- 8/10/2007 19:52:09 >
AQ  Post #: 16
8/10/2007 21:10:13   
flsg
Member

somebody621: you DO need to override. Or else it generates an error. And you're right, if someone can understand your code, they'll know they need to put the package lol

EragonZZZZ: it's not about straightforward or not. If you throw an error, you need to add, or enclose it in try and catch statement. Or else if you don't do it, when the error is thrown, AS doesn't have a way to "catch" it. You can try, even if you don't put a correct number, the error will never appear

edit: wow, what was the last time I said so much deep things in one day? XD >_<

< Message edited by flsg -- 8/10/2007 21:11:40 >
AQ  Post #: 17
8/10/2007 22:08:06   
EragonZZZZ
Member

you want to explain a try-catch statement then, cause I don't use them very often, cause all my errors are caught with 'trace' for now.
AQ  Post #: 18
8/11/2007 9:03:43   
petermaxo
Member

does the lack of answers I am recieving mean that noone has any suggestions?
AQ DF  Post #: 19
8/11/2007 9:45:33   
somebody621
Member

Straight from the AS3 livedocs: Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function toString():String instead of using an override of the base class.

hehe

And may you please explain try-catch statements?

About the x and y not being private, it's so much easier in the long run as you constantly have to get/set x and y values individually, and it would be pointless to have something like this:

private var _x:Number;
private var _y:Number;

...

public function get x():Number{
return _x;
}

public function set x(value:Number):void{
_x = value;
}

etc.

I agree that it's less OOP, and that it's very important to be OOP most of the time; however, I personally think that this is an exception.


SirSchmoopy: I would advise you to do something else, as this goes very far into pathfinding, and it gets pretty complicated even if you're level is a straight plane with a few holes.

Peter: It's not really good to use _global a lot as you run into many scope problems later on. Also, you shouldn't work with scenes but rather frames. In fact, experienced users fit all their game/code on one frame.

< Message edited by somebody621 -- 8/11/2007 10:00:21 >
Post #: 20
8/11/2007 10:23:56   
EragonZZZZ
Member

quote:

experienced users fit all their game/code on one frame.


I beg to differ.
Sometimes I'll define different layers with names such as this

Constants
Functions
Maps
etc.

Constants holds game constants that I want throughout the game. I do know that this can be done with OOP, but that only makes the constants available through classes and I sometimes want them available to all game functions, OOP or not.

Functions holds functions that I want to be available to all parts of the game. Basically the same as Constants

Maps holds things like arrays with map data for tile based systems, etc.

Now, before you let me know that all this code could fit on one frame, I KNOW.
However, which is easier to manage?
Finding all the code when it's blended together on one frame, or being split up into different layers?
Also makes it easier to look up function names that you may have forgotten. Good comments help too.
Obviously the main() loop/layer is positioned so it initializes last.
AQ  Post #: 21
8/11/2007 13:34:31   
flsg
Member

EragonZZZZ: one frame means 1 frame, not 2, not 3, etc. It CAN have multiple layers lol

somebody621: sorry, didn't see that your class doesn't extend MovieClip or Sprite, or else override is nessesary
when you throw a new Error, AS has NO way to "catch" the error if you don't define a try and catch block.
AQ  Post #: 22
8/11/2007 16:07:04   
The Illusive Man
Member

peter - i'm half braindead atm, i can't quite help anyone lol - i'll be fine in the morning :) I don't quite understand these _globals you keep using... i have never come across them before *prepares for slap from flsg*
Post #: 23
8/11/2007 16:22:21   
EragonZZZZ
Member

Don't worry, flsg isn't going to slap you.
Thats my job.
*SLAP*

and before I go any further, sorry flsg, I misinterpreted what he meant...you can see why?

Back to you althorne.
*hands icepack*
So anyway, _global is a way to define a variable so that your entire .fla file has access to it.
Every movieclip, every frame, every layer, and every scene...anyplace you put Actionscript...has access to it.
However, it gets sort of messy. I don't use it, so I'm not aware of the syntax or the scope problems you have with using it. :P
But you will have some problems. lol.
AQ  Post #: 24
8/11/2007 17:00:00   
flsg
Member

althorne: I won't slap you(although I should, did I just spent so much time explaining for nothing? XD)
eragon: are you learning AS3?

< Message edited by flsg -- 8/11/2007 17:12:57 >
AQ  Post #: 25
Page:   [1] 2 3 4 5   next >   >>
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> Flash Q&A Thread 4
Page 1 of 3012345>»
Jump to:






Icon Legend
New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Content Copyright © 2018 Artix Entertainment, LLC.

"AdventureQuest", "DragonFable", "MechQuest", "EpicDuel", "BattleOn.com", "AdventureQuest Worlds", "Artix Entertainment"
and all game character names are either trademarks or registered trademarks of Artix Entertainment, LLC. All rights are reserved.
PRIVACY POLICY


Forum Software © ASPPlayground.NET Advanced Edition