RE: Flash Q&A thread 2 ** checked everyday (Full Version)

All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy



Message


imdark -> RE: Flash Q&A thread 2 ** checked everyday (6/14/2006 10:45:38)

its not that simple thye used api to draw it
il make one whan il come home




mathus the seconth -> RE: Flash Q&A thread 2 ** checked everyday (6/14/2006 14:31:54)

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)




somebody621 -> RE: Flash Q&A thread 2 ** checked everyday (6/14/2006 15:26:05)

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?




mathus the seconth -> RE: Flash Q&A thread 2 ** checked everyday (6/14/2006 15:35:43)

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.




flsg -> RE: Flash Q&A thread 2 ** checked everyday (6/14/2006 17:18:13)

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())
.............................[>:]




lil boi blue -> RE: Flash Q&A thread 2 ** checked everyday (6/15/2006 0:30:41)

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




Zoltan -> RE: Flash Q&A thread 2 ** checked everyday (6/15/2006 3:23:00)

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!! [8D] 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!




somebody621 -> RE: Flash Q&A thread 2 ** checked everyday (6/15/2006 14:38:34)

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





flsg -> RE: Flash Q&A thread 2 ** checked everyday (6/15/2006 15:16:39)

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




mathus the seconth -> RE: Flash Q&A thread 2 ** checked everyday (6/15/2006 20:10:09)

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




flsg -> RE: Flash Q&A thread 2 ** checked everyday (6/15/2006 20:51:39)

where did you get that code?




mathus the seconth -> RE: Flash Q&A thread 2 ** checked everyday (6/15/2006 21:56:54)

for the circle? in the flash 8 help files. the rest i made.




somebody621 -> RE: Flash Q&A thread 2 ** checked everyday (6/15/2006 22:53:59)

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)




mathus the seconth -> RE: Flash Q&A thread 2 ** checked everyday (6/15/2006 23:32:25)

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?




Zoltan -> RE: Flash Q&A thread 2 ** checked everyday (6/15/2006 23:42:00)

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




lil boi blue -> RE: Flash Q&A thread 2 ** checked everyday (6/16/2006 17:05:29)

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




Eddie -> RE: Flash Q&A thread 2 ** checked everyday (6/17/2006 19:21:45)

Too many frames and too laggy.




lil boi blue -> RE: Flash Q&A thread 2 ** checked everyday (6/17/2006 20:27:32)

lol, actually its only 24 frames but i know its too laggy, its perfect on my compy buy all laggy on here




Eddie -> RE: Flash Q&A thread 2 ** checked everyday (6/17/2006 21:09:41)

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.




lil boi blue -> RE: Flash Q&A thread 2 ** checked everyday (6/17/2006 21:11:01)

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




mathus the seconth -> RE: Flash Q&A thread 2 ** checked everyday (6/24/2006 23:48:10)

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!!!




flsg -> RE: Flash Q&A thread 2 ** checked everyday (6/25/2006 15:20:25)

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




mathus the seconth -> RE: Flash Q&A thread 2 ** checked everyday (6/25/2006 23:18:37)

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!:)]




flsg -> RE: Flash Q&A thread 2 ** checked everyday (6/26/2006 13:16:45)

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




mathus the seconth -> RE: Flash Q&A thread 2 ** checked everyday (6/26/2006 15:16:15)

oh, sorry, typos happen even in code, lol [&:] flsg, do you have any books on flash by keith peters?




Page: <<   < prev  18 19 [20] 21 22   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.15625