RE: Flash Q&A thread 3 (Full Version)

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



Message


EragonZZZZ -> RE: Flash Q&A thread 3 (3/9/2007 23:17:41)

Also, quick question, is the code in the MC or the timeline. I'm not certain which.




lil boi blue -> RE: Flash Q&A thread 3 (3/10/2007 2:03:03)

its on the MC, and it worked, thanks a lot both of you. yea i needed to add the 'this' into the 'gotoAndStop' part




dominic_r_monroe -> RE: Flash Q&A thread 3 (3/11/2007 16:29:18)

i would like to learn but i haven't the program to much maybe in the fututre i'll get it cheap on ebay




Grie Velorn -> RE: Flash Q&A thread 3 (3/12/2007 1:10:59)

Yes i was wondering if there was some action script that adds points and depending on the # of points they have it plays a new frame




EragonZZZZ -> RE: Flash Q&A thread 3 (3/12/2007 15:12:42)

if (point condition...ie, what makes points earned)
{
playerPoints += 5
}

if (playerPoints >= 100)
{
gotoAndPlay(_root.currentframe + 1)
}

Or gotoAndStop. Depending on what you wish to happen




flsg -> RE: Flash Q&A thread 3 (3/12/2007 18:35:42)

well, if you have to check the points for more than once(for example, at 50 points, 200 points, 300, 500,...), I suggest you to put them in an array:

var checkValues:Array = [[50, 4], [100, "myFrameName"], [200, 29], [300, 33], [500, "win"]];
//define the array that will store the informations. The first value in the second array is the points that you need to check, the second value is the frame to play, it could be a number, a string, or a variable
var myPoints:Number = 0;
//define your points variable
myPoints += 148;
for (var i:Number = 0; i<checkValues.length; i++) {
	if (myPoints>checkValues[i][0] && myPoints<checkValues[i+1][0]) {
		_root.mcThatYouWantToPlay.gotoAndStop(checkValues[i][1]);
	}
}

here you go, something easy to maintain [:)] if you don't understand, tell me




Grie Velorn -> RE: Flash Q&A thread 3 (3/12/2007 18:44:44)

wow thanks i am wondering i have a game that im making heres a demo: Demo1.0 mabey can you show me how i would implement that?




EragonZZZZ -> RE: Flash Q&A thread 3 (3/12/2007 18:52:25)

yeah, flsg's method is mucho better cause I'm tired and busy right now.

Flsg's actionscript level is preetty much on par with if not above mine, so listen up.




flsg -> RE: Flash Q&A thread 3 (3/12/2007 18:52:57)

just put my code on the first frame and replace names that you should replace




Grie Velorn -> RE: Flash Q&A thread 3 (3/12/2007 18:55:37)

so when you kill one it should add 1 0r what ever points to the variable so.. how would i do that, add them i mean, i really no nothing about action script




flsg -> RE: Flash Q&A thread 3 (3/12/2007 19:02:39)

var checkValues:Array = [[50, 4], [100, "myFrameName"], [200, 29], [300, 33], [500, "win"]];
//define the array that will store the informations. The first value in the second array is the points that you need to check, the second value is the frame to play, it could be a number, a string, or a variable
var myPoints:Number = 0;
//define your points variable
function addPoints(points:Number):Void{
myPoints+=points
for (var i:Number = 0; i<checkValues.length; i++) {
	if (myPoints>checkValues[i][0] && myPoints<checkValues[i+1][0]) {
		_root.mcThatYouWantToPlay.gotoAndStop(checkValues[i][1]);
	}
}
}

here, if you want to add points, use addPoints(pointsYouWant2Add), and the function does the rest for you [;)]




Grie Velorn -> RE: Flash Q&A thread 3 (3/12/2007 19:05:26)

thank you so much i wont be able to try this now but ill be sure to add you the the credits
Edit is there a place that i an easyly learn action script?




EragonZZZZ -> RE: Flash Q&A thread 3 (3/12/2007 20:30:44)

Okay, there are a few options in this situation. Whichever one you pick depends on your desire and learning style:

1. You can buy one of the numerous flash teaching books to learn actionscript. I recommend
Beginning AS 2.0
Flash 8 AS Bible
OOP for AS 2.0

I would advise buying them according to skill level...the OOP one is very advanced and covers stuff that I'm using in my things.
Also, you could look up some AS 3.0 books (just thought I'd save flsg the trouble of saying that lol)

2. You can look online for tutorials or get a teacher here on the forums.
FlashKit.com, gotoAndPlay.it, and numerous other sites have great tutorials on anything you could want. The problem is, sometimes they don't teach you so much as feed you code...so watch what you read and make sure you know what code you input does. Otherwise, you're gonna have a hell of a time debugging.

Tutorials for AS on this forum are rare, though. Scripters are in a much lower demand than artists.

3. My favorite, and the way I learn every program.
Read the included help documentation. Just the first introduction. Read a bit about the scripting window and what you can do with it. Look at some examples. When you are ready, DIVE RIGHT IN! Code like crazy! Try to do random things! If you look on my computer, I have about 40+ .fla and .swf files that are just circles and rectangles and lines doing things that can be implemented in games; Multiple shots, side scrolling, jumping, walking, tileset generators....tons of mini-engines (and some not-so-mini ones, too).

Flash's debug can be tricky at first. So when you have a problem with a piece of code, just look it up in the help docs. Normally each function has a full page devoted to it. Read up on it, check the syntax. Look at the examples. Repeat.

Soon enough, you'll come to realize that you don't need to look at the help docs as often, and will become a semi-fluent (trust me, thats good) actionscripter. Now, to become what I
call a fluent actionscripter, you're gonna dedicate around 9 months of continuous scripting and crazy stuff like that...thats how long it took me....

Whoops. Never mind. I'd been programming for 5 years previously, so it might be a BIT harder for you.

________________________________


Good luck with scripting!
Feel free to PM me for help and stuff!

-Eragon


PS- Your art rocks.





Grie Velorn -> RE: Flash Q&A thread 3 (3/12/2007 20:35:46)

lol thanks i didn't realize it would be so hard(and cost so much money lol) well thanks for the help ill look some of this stuff up but i may not be very good with it or even figure out what to do
PS-Thanks




lil boi blue -> RE: Flash Q&A thread 3 (3/12/2007 20:50:14)

i love the bibles of programs, they are like twice the size of a regular bible and can actually be understood lol.




flsg -> RE: Flash Q&A thread 3 (3/12/2007 21:23:31)

yeah...that last book...OOP AS 2.0...I have it[:)]
by colin moock
he's one of the best flasher I've ever known. Try his another book:
http://www.amazon.com/ActionScript-Flash-MX-Definitive-Second/dp/059600396X/ref=pd_sim_b_2/002-8706535-4206433?ie=UTF8&qid=1173744979&sr=1-3
this is definitively the best flash AS book that you can find(I also have it lol)


quote:

ORIGINAL: Grie Velorn

lol thanks i didn't realize it would be so hard(and cost so much money lol) well thanks for the help ill look some of this stuff up but i may not be very good with it or even figure out what to do
PS-Thanks

lol, I don't think it costs a lot. The professional registered version of Flash 8.0 is way more expensive. When I get enough money, I'll buy the flash media server, which costs more than 4000$, and 1500$ for the upgrade lol




Grie Velorn -> RE: Flash Q&A thread 3 (3/12/2007 21:28:55)

Thanks flsg but the only reason i can't get it and why everything seems so expencive is i have no surce of income and no way of getting one lol but ill look into that book some more it seems nice but would it be good for some one who have no programing experince or has ever programed anything




somebody621 -> RE: Flash Q&A thread 3 (3/12/2007 22:21:39)

Or, if you're under certain conditions, mostly of age and your work company if you're grown up, you can just get the educational version. It's cheaper XD.

Oh, and the thing about here is that everybody tries to make rpgs. Very few are actually successful because scripters are so under demand. What many don't realize is that RPG's are among the hardest to script. At least start with simple puzzle games...

The thing with flash, before, was that it was so easy to quickly brew something up, and that was a reason it was attractive to newb scripters. Now with AS3, it is scaring away many newbs.

Personally, I am working with rigid body physics right now, and the classes are a MAJOR time-saver. In As2, classes were simply too slow for action games without asbroadcaster.




Grie Velorn -> RE: Flash Q&A thread 3 (3/12/2007 22:30:08)

were can i find the educational version




Myhos -> RE: Flash Q&A thread 3 (3/13/2007 8:41:52)

quote:

ORIGINAL: somebody621

Or, if you're under certain conditions, mostly of age and your work company if you're grown up, you can just get the educational version. It's cheaper XD.

Oh, and the thing about here is that everybody tries to make rpgs. Very few are actually successful because scripters are so under demand. What many don't realize is that RPG's are among the hardest to script. At least start with simple puzzle games...

The thing with flash, before, was that it was so easy to quickly brew something up, and that was a reason it was attractive to newb scripters. Now with AS3, it is scaring away many newbs.

Personally, I am working with rigid body physics right now, and the classes are a MAJOR time-saver. In As2, classes were simply too slow for action games without asbroadcaster.


Sure the Educational version is cheaper but you have less options with it and some limits. You also need a student ID or a teacher to get it.
AS3? are you kidding me??? Its out?!?!?! Where!?!?! *fan girl eh boy scream*. Anyhow personally I rather make small games then rpgs.




EragonZZZZ -> RE: Flash Q&A thread 3 (3/13/2007 15:04:57)

Okay, time to respond to a couple inaccuracies in Myhos's post. And the questions, too.
quote:


Sure the Educational version is cheaper but you have less options with it and some limits. You also need a student ID or a teacher to get it.


Sorry, but thats completely wrong. You can buy Flash educational for different discounts depending on where and how you get it...Normally its through a family member. I got a $700 discount on the entire Flash/FireWorks/Dreamweaver/Contribute/FlashPaper suite and none of those are limited versions.


And yeah, flash 9 AS3 is out. I've decided to start learning it. Get it at Adobe.com




Myhos -> RE: Flash Q&A thread 3 (3/13/2007 16:30:55)

There are limits to the license and there are a few small limits (at least thats true with the Flash MX 2004 education ver.) and the only way i know how to get its via teacher or student id.

edit: yea there are no limits in the edu and you have to agree that you can't use it for pro things like game making and anything else which you can make a profit from.




petermaxo -> RE: Flash Q&A thread 3 (3/13/2007 17:06:03)

can anyone tell me what is wrong with this game? this part is the begining where In am trying to make it possible to customize your character. I only included relevent script.
ccolor and style are variables.

Scene 1: contains button "charcreate"

_global.ccolor = 0
_global.style = 1
_root.onEnterFrame = function(){
gotoAndStop(1)
//stops playhead from advancing to next scene
}

characrate:
on(release){
gotoAndStop("Scene 2",1)
//moves playhead to next scene
}

Scene 2: buttons "styleup", "styledown", "continue"

_root.onEnterFrame = function(){
gotoAndStop(1)
//stops playhead from advancing to next scene
}

styleup:
on(release){
if (style < 5){
style += 1
}
//causes the variable style to increase by 1 if it is less than 5
}
styledown:
on(release){
if (style > 1){
style -= 1
}
//causes the variable style to decrease by 1 if it is greater than 1
}

continue:
on(release){
gotoAndStop("Scene 3",1)
//advances playhead to next scene
}

Scene 3: button "color1-10"

_root.onEnterFrame = function(){
trace(ccolor);
gotoAndStop(1)
//stops playhead from advancing to next scene
}

Colorn:
on(release){
ccolor = n
//changes the variable ccolor to the nomber of the color button pressed
}




there is a movie clip called "display" which shows what your character looks like. It has 10 different colors with an instance name attatched to them which is their color. the script attatched to the movie clip is this:

_root.onEnterFrame = function(){
if (ccolor == 1){
red._visible = true
}if(ccolor!= 1){
red._visible = false
}if (ccolor == 3){
yellow._visible = true
}if(ccolor!= 3){
yellow._visible = false
}if (ccolor == 2){
orange._visible = true
}if(ccolor!= 2){
orange._visible = false
}if (ccolor == 4){
green._visible = true
}if(ccolor!= 4){
green._visible = false
}if (ccolor == 5){
blue._visible = true
}if(ccolor!= 5){
blue._visible = false
}if (ccolor == 6){
indigo._visible = true
}if(ccolor!= 6){
indigo._visible = false
}if (ccolor == 7){
purple._visible = true
}if(ccolor!= 7){
purple._visible = false
}if (ccolor == 8){
white._visible = true
}if(ccolor!= 8){
white._visible = false
}if (ccolor == 9){
black._visible = true
}if(ccolor!= 9){
black._visible = false
}if (ccolor == 0){
silver._visible = true
}if(ccolor!= 0){
silver._visible = false
}
//these mean that a certain variable for color makes a certain color of player visible (ex. if ccolor = 1, the player is red.) they also make it so that if the variable is not the one required for the color, the color will not appear (ex. if ccolor is not equal to 1, the player is not red.)
}



the problem I am experiencing is that once Scene 3 is being shown, all script-controlled action stops. it doesn't trace ccolor, and nothing else happens.




EragonZZZZ -> RE: Flash Q&A thread 3 (3/13/2007 18:26:12)

Mythos, do you know if you can pay to upgrade (like, pay the difference or discount) so that you could be allowed to make games, etc?




flsg -> RE: Flash Q&A thread 3 (3/13/2007 19:30:58)

petermaxo: wow, could you at least tell us what's wrong with your script? XD because nobody has the patience to read all that lol

I looked at some of the lines, and I don't understand why you're using onEnterFrame. This event allows you to replay the code inside it everytime a frame passes. That's perhaps your bug. just simply remove it(well, I'm not sure what you're trying to do XD)

also, if you define _root.onEnterFrame more than once, the newer code replace the older code(which means the older code inside your onEnterFrame event dissapear)

and, if you use if() a lot, I suggest you to use switch()+case, which is easier to read




Page: <<   < prev  1 [2] 3 4 5   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.125