Home  | Login  | Register  | Help  | Play 

RE: Flash Q&A thread 3

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A thread 3
Page 3 of 16«<12345>»
Forum Login
Message << Older Topic   Newer Topic >>
3/13/2007 20:12:29   
Myhos
Member

Eragon the are you going to be making games for profit? if yes then your going to have to pick up a pro version but as long as its a free game it most likely will be ok with the agreement, but as far as i know, you can't upgrade to pro, unless your upgrading to a newer version (when flash 9 comes out and you can get upgrade for the pro version)

alright now for helping with code;

First before we can help you, help us help you: add in some comments (//LOL COMMENT) in the code so we can see what your trying to do, ex:

_root.onEnterFrame = function(){
gotoAndStop(1) // go to the main frame, etc
}
styleup:
on(release){
if (style < 5){ // make sure that the style will be larger then 5 so this can work or that, blah blah
style += 1
}
}
}

also its much better to do this all on the frames instead of on the movie clips.
AQ DF  Post #: 51
3/13/2007 21:38:36   
EragonZZZZ
Member

Yeah, Mythos, you're like a mind reader. Thats exactly what I'm going to do.

Why pay for a new version of the old when you can get a new version of the new?

Actually, I already have the beta, which ISN'T an education version. So technically, anything I do with Flash 9 is legal. Time to copy over all my graphics XD.
AQ  Post #: 52
3/14/2007 8:15:39   
Myhos
Member

Lol unfortunately for me, the flash 9 beta only works with the old Power PC macs and not the new Intel chip macs :( (I have Flash 8 on my mac)
AQ DF  Post #: 53
3/14/2007 9:20:33   
petermaxo
Member

quote:

ORIGINAL: flsg
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


I don't know a lot of code. I basicly taught myself to use everything to the fullest extent. about _root.onEnterFrame- 1. what else would I use? 2. I think you are misunderstanding my format. I only use onEnterFrame once per scene/clip. What is switch()+case?
AQ DF  Post #: 54
3/14/2007 18:10:12   
ponycoltraine
Member

i used to be a scripter but gave it up for being an animator/drawer

i made a hand tut a little while ago its not my best but it helps
http://i81.photobucket.com/albums/j231/chubbs153/handtut.swf

and i cant post my other script link its a **********link

< Message edited by chubbs123 -- 3/14/2007 18:15:06 >
AQ  Post #: 55
3/14/2007 18:57:54   
EragonZZZZ
Member

Haha, yeah, I figured out what newgrounds was when I saw your tutorial.

And flsg, AS 2.0 can do CASE? What?!?! Why didn't anyone TELL me? Arggghhh...That would've made my life so much easier...eeeeekkkk..

What's the syntax?
AQ  Post #: 56
3/14/2007 19:33:42   
flsg
Member

eragon: are we talking about the same "case"?
switch (condition) {
case A :
  //code
  break
case B :
  //code
  break;
case C :
  // code
  break;
default :
  // code
  break;
}

example:
switch (_root.username.text) {
case "eragon" :
  trace("hi eragon")
  break
case "flsg" :
  trace("how are you flsg?")
  break;
case "Artix" ://without break, it's like using || in if()
case "Twilly":
  trace("I want to play AQ")
  break;
  default ://occurs when none of the conditions above are meet
  trace("hi")
  break;
}

petermaxo: I think you don't understand. onEnterFrame runs the code automatically every time a frame passes, event if you only have one frame in the entire movie

< Message edited by flsg -- 3/14/2007 19:36:54 >
AQ  Post #: 57
3/14/2007 19:34:10   
ponycoltraine
Member

well its on that one site that starts with new and thats all i can tell you and you can find it by searching big bad tutorial (for those who know the site u can find it if not sorry thats all i can say)
AQ  Post #: 58
3/15/2007 8:24:24   
petermaxo
Member

flsg: but what should I use instead? Anyway, I've already said that my problem is that NOTHING happens.
AQ DF  Post #: 59
3/15/2007 8:27:09   
Myhos
Member


quote:

ORIGINAL: EragonZZZZ

Haha, yeah, I figured out what newgrounds was when I saw your tutorial.

And flsg, AS 2.0 can do CASE? What?!?! Why didn't anyone TELL me? Arggghhh...That would've made my life so much easier...eeeeekkkk..

What's the syntax?


Syntax is a nasty little part of every language. Its pretty much the order of your code, underscores "_", ".", etc. syntax errors are the worst possible error.
AQ DF  Post #: 60
3/15/2007 8:31:18   
petermaxo
Member

I think he wants you to tell him the syntax rules for cases.

edit: I have isolated the problem in my actionscript. The simplified problem codes are:

Scene 3:
_global.c = 0
_root.onEnterFrame = function(){
if(Key.isDown(Key.UP)){
c = 1
}if(Key.isDown(Key.DOWN)){
c = 2
}trace(c)
}

player (mc in Scene 3, contains mcs p1 and p2):

_root.onEnterFrame = function(){
if(c == 1){
p1._visible = true
}if(c != 1){
p1._visible = false
}if(c == 2){
p2._visible = true
}if(c != 2){
p2._visible = false
}

}

again, the problem is that all coding is not working once the scene is entered. italicised parts are not bugged.

edit 2:
I figured out how to make it work if you press the player movie clip. If someone could tell me how to do it with seperate buttons, that would be good.

I added this code to the movie clip
onClipEvent(mouseDown){
c = 2
}

< Message edited by petermaxo -- 3/15/2007 9:38:13 >
AQ DF  Post #: 61
3/15/2007 9:21:03   
Myhos
Member

ok well first of all, you have some unneeded code, I changed it and fixed it up:

_global.c = 0; //(you forgot EVERY semicolon DOH!)
_root.onEnterFrame = function(){
if(Key.isDown(Key.UP)){
c = 1;
}if(Key.isDown(Key.DOWN)){
c = 2;
}trace("c"); // (I fixed your trace function, it should work now)
}
_root.onEnterFrame = function(){
if(c == 1){
p1._visible = true;
p2._visible = false;
trace("P1 visible is working"); // you can kill this line of code if it works
}
}if(c == 2){
p2._visible = true;
p1._visible = false;
trace("P1 visible is working"); // you can kill this line of code if it works
}
}



It should work now n_n
btw a stop(); command should help a tad bit in there

< Message edited by Myhos -- 3/15/2007 9:24:48 >


_____________________________

AQ DF  Post #: 62
3/15/2007 9:27:56   
petermaxo
Member

I thought that semicolons were optional, and I almost never use them, and I have never had any trouble before. Also, the trace function is supposed to trace the variable c, not the message "c". It doesn't trace c or "c", and if I want to do anything bigger, it is much longer than my original. And it still doesn't work.
AQ DF  Post #: 63
3/15/2007 9:31:55   
Myhos
Member

Hmmm lets see....try this:

instead of _global.c = 0

do:

var c = 0;

btw what version of flash and action script are you useing?

also its better to put semicolons after each statment

< Message edited by Myhos -- 3/15/2007 9:45:49 >
AQ DF  Post #: 64
3/15/2007 15:50:13   
petermaxo
Member

does using var have the same effect as _global., i.e. it globalizes the variable?

Flash MX 2004, educational version.
AQ DF  Post #: 65
3/15/2007 17:57:01   
EragonZZZZ
Member

Whoops, I was thinking of a totally different case >.> <.<

and as for this:

quote:

Syntax is a nasty little part of every language. Its pretty much the order of your code, underscores "_", ".", etc. syntax errors are the worst possible error.


Don't worry, I know what syntax is. I meant the syntax for the "case" language element which actually doesn't exist. I got "case" confused with "stacks"

Which, ironically, I figured out (by meself) that flash can do! Yay!

AQ  Post #: 66
3/15/2007 20:30:17   
Myhos
Member

alright try this:

init();
function init(){
var c = 0;
}
onEnterFrame = function(){
if(Key.isDown(Key.UP)){
c = 1;
}if(Key.isDown(Key.DOWN)){
c = 2;
}trace(c);
}
AQ DF  Post #: 67
3/16/2007 16:57:23   
petermaxo
Member

same problem as before. c isn't traced, the mc does nothing.
AQ DF  Post #: 68
3/16/2007 17:06:52   
Myhos
Member

damn... email me a example of the flash file, let me take a crack at it
AQ DF  Post #: 69
3/16/2007 17:21:07   
petermaxo
Member

How do you attatch .fla files to an email through the forum? (or anything else?)
AQ DF  Post #: 70
3/16/2007 18:32:05   
flsg
Member

I'm back
petermaxo: you should learn a little bit the variable scope
your code doesn't work because:
this.p1 and this.p2 since they're not in _root
the second onEnterFrame just erased the first one because you re-declarated it
AQ  Post #: 71
3/16/2007 18:50:50   
petermaxo
Member

Oh! now I get it. Thanks

edit: It Works!!!

By the way, what class should you export dynamicly created movie clips as?

< Message edited by petermaxo -- 3/16/2007 20:45:45 >
AQ DF  Post #: 72
3/17/2007 13:19:44   
flsg
Member

dynamically created MC? I don't understand your question...
you create run-time mc by using targetName.createEmptyMovieClip()
AQ  Post #: 73
3/17/2007 16:48:26   
petermaxo
Member

Never mind, I figured it out. By the way, is there any way to make something happen when the last frame of movie clip is loaded?

Edit: also, I have a string of code trying to attatch a movie clip to the _root. and make it play. Here is the (somewhat shortened) code:

_root.onEnterFrame = function(){
if(back == 1){
_root.attachMovie("grassback", "back", 1,{_x:225,_y:200})
}if(ename == "green slime"){
_root.attachMovie("greenslimeattack", "enemy", 2,{_x:400,_y:200})
}_root.enemy.play()
}

sometimes, the movie clip 'greenslimeattack' won't play, or it will be delayed. does anyone know what's wrong?


< Message edited by petermaxo -- 3/20/2007 18:19:41 >
AQ DF  Post #: 74
3/19/2007 21:28:16   
flsg
Member

you use too much onEnterFrame, but for now it's ok
what do you mean by the last frame? Do you mean to run a code when the mc is fully loaded? Or else just put a piece of code on that last frame
AQ  Post #: 75
Page:   <<   < prev  1 2 [3] 4 5   next >   >>
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A thread 3
Page 3 of 16«<12345>»
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