Home  | Login  | Register  | Help  | Play 

RE: Flash Q&A thread 2 ** checked everyday

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A thread 2 ** checked everyday
Page 20 of 24«<1819202122>»
Forum Login
Message << Older Topic   Newer Topic >>
6/14/2006 10:45:38   
imdark
Member

its not that simple thye used api to draw it
il make one whan il come home
AQ  Post #: 476
6/14/2006 14:31:54   
mathus the seconth
Member

well i thought it will be too complicated to use api for the big circle so i used a circle i drew and the pythagorian theory for calculating distance, ill post it here:


             _____________________________________
distance = \/(x2-x1) * (x2-x1) + (y2-y1) * (x2-x1)


< Message edited by mathus the seconth -- 6/14/2006 14:32:39 >
AQ  Post #: 477
6/14/2006 15:26:05   
somebody621
Member

Lol. I actually did something very similar recently. I wonder why...
Oh well.
Curently working on more tile-based... Actually doing quite well.
Like this?
var ASCII = key.getASCII;
key = keyArray[key];
Written right on the spot.
Any other ways?
Post #: 478
6/14/2006 15:35:43   
mathus the seconth
Member

well, I really dont know it, I dont usually work with the keyboard, if not with the mouse. Ill post it here when i find a way.

EDIT: here we go:

var key:Object = new Object();
key.onKeyUp = function() {
	pressedKey = String.fromCharCode(Key.getAscii());
};
Key.addListener(key);


this was ment to be put on a frame.

people should let go of the habbit of puting actions on movie clips,they shold put them on an actions layer.


< Message edited by mathus the seconth -- 6/14/2006 16:02:26 >
AQ  Post #: 479
6/14/2006 17:18:13   
flsg
Member

somebody: a small question: your ASCII var, do you want a reference of the function or the return value?
Because without the (), it's a reference of the function, so in the future you'll need to use this: ASCII()

mathus the seconth: arrgh!!!!! I knew it, I knew it!!! I searched everywhere in the Key Object documentation, but I didn't think it was in String Object!!! (String.fromCharCode())
.............................
AQ  Post #: 480
6/15/2006 0:30:41   
lil boi blue
Member

http://i5.photobucket.com/albums/y158/photo12/armidillo.swf

you see> i lived up to my word and made theamidillo with the rocket launcher....HES MEXICAN
AQ DF  Post #: 481
6/15/2006 3:23:00   
Zoltan
Member

Hey Guys! thats one mega awesome drawing blue!... The reason Im never in here is because well im jsut to cool, well not realy but... its because ive been busy doing more imporntant stuff like preperation for University... Ive been learning C/C++ (mainly C++) just recently!!! so dont ask me anything!! Also I have recently aquired some expensive software, for free I might add called 3DTK universe modler and 3DTK univers animator ! which allows you to do heaps and heaps of great stuff ( Link Just a 20 sec throw together in 3d modler so basic it hurts)

So Im gonna have fun with that!
Post #: 482
6/15/2006 14:38:34   
somebody621
Member

Awesome, even thought you told me to do it.
Zoltan:That's dimetric, not 3-d; lol.



< Message edited by somebody621 -- 6/15/2006 14:59:38 >
Post #: 483
6/15/2006 15:16:39   
flsg
Member

Zoltan: wow, I wish you luck I'm too scared to learn C++(too hard for me)
somebody: it's 3D, I think he's working with 3DS Max

< Message edited by flsg -- 6/15/2006 15:31:34 >


_____________________________

My flash gallery
my game thread

flsg, proud old member of AQ(still playing :O)
AQ  Post #: 484
6/15/2006 20:10:09   
mathus the seconth
Member

alright guys. pop quiz over!, to make the circumeter, paste this code on the first frame of the movie.

_root.createEmptyMovieClip("circle", 1);
_root.createEmptyMovieClip("circle2", 2);
_root.createEmptyMovieClip("circle3", 3);
_root.createEmptyMovieClip("line", 4);
function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void {
	with (mc) {
		moveTo(x+r, y);
		curveTo(r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
		curveTo(Math.tan(Math.PI/8)*r+x, r+y, x, r+y);
		curveTo(-Math.tan(Math.PI/8)*r+x, r+y, -Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
		curveTo(-r+x, Math.tan(Math.PI/8)*r+y, -r+x, y);
		curveTo(-r+x, -Math.tan(Math.PI/8)*r+y, -Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
		curveTo(-Math.tan(Math.PI/8)*r+x, -r+y, x, -r+y);
		curveTo(Math.tan(Math.PI/8)*r+x, -r+y, Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
		curveTo(r+x, -Math.tan(Math.PI/8)*r+y, r+x, y);
	}
}
circle3.lineStyle(1, 0x000000, 100);
drawCircle(circle3, 275, 200, 5);
_root.onMouseMove = function() {
	var x:Number = _root._xmouse;
	var y:Number = _root._ymouse;
	var cx:Number = 275;
	var cy:Number = 200;
	var prox:Number = Math.sqrt((x-cx)*(x-cx)+(y-cy)*(y-cy));
	with (line) {
		clear();
		moveTo(275, 200);
		lineStyle(1, 0x000000, 100);
		lineTo(_root._xmouse, _root._ymouse);
	}
	with (circle) {
		clear();
		lineStyle(1, 0x000000, 100);
	}
	with (circle2) {
		clear();
		lineStyle(1, 0x000000, 100);
	}
	drawCircle(circle2, x, y, 5);
	drawCircle(circle, cx, cy, prox);
	updateAfterEvent();
};


a whole, bug-free circmeter in only 43 lines!!!

AND to prove im the master of draw API, to make a cross hair put this code on the first frame.


_root.createEmptyMovieClip("circle", 1);
_root.createEmptyMovieClip("xLine", 2);
_root.createEmptyMovieClip("yLine", 3);
function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void {
	with (mc) {
		moveTo(x+r, y);
		curveTo(r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
		curveTo(Math.tan(Math.PI/8)*r+x, r+y, x, r+y);
		curveTo(-Math.tan(Math.PI/8)*r+x, r+y, -Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
		curveTo(-r+x, Math.tan(Math.PI/8)*r+y, -r+x, y);
		curveTo(-r+x, -Math.tan(Math.PI/8)*r+y, -Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
		curveTo(-Math.tan(Math.PI/8)*r+x, -r+y, x, -r+y);
		curveTo(Math.tan(Math.PI/8)*r+x, -r+y, Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
		curveTo(r+x, -Math.tan(Math.PI/8)*r+y, r+x, y);
	}
}
with (xLine) {
	lineStyle(1, 0x000000);
	moveTo(0, Stage.height/2);
	lineTo(Stage.width, Stage.height/2);
}
with (yLine) {
	lineStyle(1, 0x000000);
	moveTo(Stage.width/2, 0);
	lineTo(Stage.width/2, Stage.height);
}
_root.onMouseMove = function() {
	with (circle) {
		clear();
		lineStyle(1, 0x000000);
	}
	drawCircle(circle, _root._xmouse, _root._ymouse, 50);
	xLine._y = _root._ymouse-Stage.height/2;
	yLine._x = _root._xmouse-Stage.width/2;
	updateAfterEvent();
};


< Message edited by mathus the seconth -- 6/15/2006 20:21:30 >


_____________________________

AQ  Post #: 485
6/15/2006 20:51:39   
flsg
Member

where did you get that code?
AQ  Post #: 486
6/15/2006 21:56:54   
mathus the seconth
Member

for the circle? in the flash 8 help files. the rest i made.
AQ  Post #: 487
6/15/2006 22:53:59   
somebody621
Member

You should credit some one if you used their code, ya know.

BTW: that had no perspective in the image. It's some kind of axonometric projection (I think dimetric)

< Message edited by somebody621 -- 6/15/2006 22:58:35 >
Post #: 488
6/15/2006 23:32:25   
mathus the seconth
Member

dude, who am i gonna credit? I got the drawCircle from the from the flash 8 help files. if i credit anyone, i credit macromedia (or adobe). But i made that code myself.

So any typos or suggestions in my code?
AQ  Post #: 489
6/15/2006 23:42:00   
Zoltan
Member

Somebody... The software is 3DTK universe modler... and the windows can be rotated to see the object from any angle... it starts off at isometric but I just rotated it to the best view....

Also this a pretty cool website for tutorials... just needs to grow abit... http://www.toxiclab.org
Post #: 490
6/16/2006 17:05:29   
lil boi blue
Member

wow, that place looks pretty cool, i'll try to send in an effect...i'll make one....OO, i'll submit my supernova, been working on it for awhile, its hell hard, because you need glows + particle effects + growing star + implosion = coolest thing ever


EDIT: here is the super nova movie supernova

< Message edited by lil boi blue -- 6/17/2006 0:16:06 >
AQ DF  Post #: 491
6/17/2006 19:21:45   
Eddie
Member

Too many frames and too laggy.
AQ  Post #: 492
6/17/2006 20:27:32   
lil boi blue
Member

lol, actually its only 24 frames but i know its too laggy, its perfect on my compy buy all laggy on here
AQ DF  Post #: 493
6/17/2006 21:09:41   
Eddie
Member

i got new comp and lost every file.And this one is alot faster but something about not working with Macromedia or something im shutting off internet to try again.
AQ  Post #: 494
6/17/2006 21:11:01   
lil boi blue
Member

well when you break in the new computers it takes a good week or so before internet runs as smoothly as it does on other computers, just try to download the latest plugin again
AQ DF  Post #: 495
6/24/2006 23:48:10   
mathus the seconth
Member

alright I havent come here for a week because I was in domenican republic. flsg, i have a question how do I add a class?(I want to type "import flash.class.subclass"instead of saying "#include "class.as""

EDIT: I GOT THE FLASH 8 ACTIONSCRIPT BIBLE!!!

< Message edited by mathus the seconth -- 6/24/2006 23:51:18 >
AQ  Post #: 496
6/25/2006 15:20:25   
flsg
Member

mathus the seconth: I was waiting for that question lol
you see, a class generaly reside in a different folder(it's a good OOP practice), and when you include it, you need to type the full name of that class:
#include "Classes/myClasses/MyClass.as"
var instance1:Classes.myClasses.MyClass=new Classes.myClasses.MyClass()

you see? It becomes long if you use this all the time in your code
so Flash MX 2004 introduced a new way:
import Classes.myClasses.MyClass
var instance1:MyClass=new MyClass()

once you imported a class, you can use it's short name instand of typing the hole name+the folders' name

some informations:
1. A class' name should be exactly the same as its .as file's name(case sensitive). For exemple, a class GameController must be in a file named GameController.as
2. If you import a class and it shows an error in the output box when you run the movie, then it means your .fla file can't find you class. For exemple, the myMovie.fla is in the "works" folder, MyClass.as is in works/classes/myClasses folder. Your class name shouldn't be "MyClass.as", but "works.classes.myClasses.MyClass.as"!!! The initialization in the file too:
class works.classes.myClasses.MyClass{
    ///codes here...
}

when you import it:
import works.classes.myClasses.MyClass
var instance1:MyClass=new MyClass()

3. You can import multiple classes at same time by using "*". For exemple, if you have 3 classes in the "myClasses" folder, use this:
import MyClasses.*

4. Generaly, class name start with an upper-case letter

hope that helps
edit: congradulation. I hope you become a good programmer

< Message edited by flsg -- 6/25/2006 15:26:15 >
AQ  Post #: 497
6/25/2006 23:18:37   
mathus the seconth
Member

for: somebody:

quote:

ORIGINAL: somebody621

What do you teach? I might be able to learn something here. Also, does AS have some kind of onError or anything like that?


use


try

catch

throw

finally





for: flsg
thanks!:)]

< Message edited by mathus the seconth -- 6/26/2006 15:12:52 >
AQ  Post #: 498
6/26/2006 13:16:45   
flsg
Member

mathus the seconth: you're welcome
and, it's finally, not finnaly lol
let me show somebody an exemple:
//an normal function
function setDimention(num:Number){
    try{
        //here's what happens whne we assign a meanless number
        if(num<0){
            //the throw operator throw an temp instance of the Error class
            throw new Error("the number is smaller than 0")
        }
        //now, if that's the case, all statements in the try block stop, and Flash execute the catch block
    }catch(e:Error){
            //e is the instance of the Error class, the message property is the message. You can have more than one catch block
            trace("an error occurred :"+e.message)
    }finally{
            //this code will always execute, even if there's an Error(which cause the try block to end)
            trace("hello")
    }


< Message edited by flsg -- 6/26/2006 13:17:37 >
AQ  Post #: 499
6/26/2006 15:16:15   
mathus the seconth
Member

oh, sorry, typos happen even in code, lol flsg, do you have any books on flash by keith peters?
AQ  Post #: 500
Page:   <<   < prev  18 19 [20] 21 22   next >   >>
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A thread 2 ** checked everyday
Page 20 of 24«<1819202122>»
Jump to:



Advertisement




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