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

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



Message


flsg -> RE: Flash Q&A thread 3 (3/29/2007 21:41:06)

petermaxo: i didn't completly understand your question, but I think that's you should remove the first onEnterFrame, since every time a frame passes it redefine the variable action. If you change it in a frame, the next second it will re-become hit




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

Okay, let me explain it better. I told it to attatch the movie "playerhit" whenever the variable _global.action = "hit". on 1 frame in the movie clip "greenslimeattack", which is attached earlier, the variable _global.action = hit. when I run the movie, _global.variable != hit, no matter how many times the frame in the movie clip goes by.




petermaxo -> RE: Flash Q&A thread 3 (4/5/2007 15:52:21)

quote:

Okay, let me explain it better. I told it to attatch the movie "playerhit" whenever the variable _global.action = "hit". on 1 frame in the movie clip "greenslimeattack", which is attached earlier, the variable _global.action = hit. when I run the movie, _global.variable != hit, no matter how many times the frame in the movie clip goes by.


some more clarification, the total script is:

on the scene:

if(_global.back == 1){
_root.attachMovie("grassback", "back", 1,{_x:335,_y:300})
}if(_global.back == 2){
_root.attachMovie("labback1", "back", 1,{_x:335,_y:300})
}if(_global.back == 3){
_root.attachMovie("labback2", "back", 1,{_x:335,_y:300})
}if(_global.back == 4){
_root.attachMovie("riverback", "back", 1,{_x:335,_y:300}) // determines the background
}if(_global.ename == "green slime"){
_root.attachMovie("greenslimeattack", "enemy", 3,{_x:400,_y:300})// determines the enemy
}_root.enemy.play()// plays the enemy movie
_root.onEnterFrame = function(){
if(_global.action == "hit"){
_root.attachMovie("playerhit", "player", 2, {_x:200,_y:300})// attatches the movie "playerhit" if action = "hit"
}if(_global.action == "attackcomplete"){
gotoAndStop("battle")
}
}




on the movie clip "greenslimeattack" frame 6:

_global.action = "hit"



Edit: is it just me, or have things been a little quiet around here?

I have another problem. what code should I use to set the global variable eaction to "attack" when the movie clip enemy is within 50 pixils of the movie clip player?




Myhos -> RE: Flash Q&A thread 3 (4/11/2007 15:58:15)

Eh sorry I'm busy doing other things, I honestly can't understand what your trying to do so sorry :( anyhow I'm working o something else having to do with flash, if i'll need help i'll post here~myhos signing off(for now)




petermaxo -> RE: Flash Q&A thread 3 (4/15/2007 10:07:49)

okay, I figured out what was wrong with my earlier script, but ran into ANOTHER problem. how does one destroy a movie clip attatched to the root?




flsg -> RE: Flash Q&A thread 3 (4/17/2007 17:29:35)

petermaxo: check the help document
it's _root.removeMovieClip(clipName)




petermaxo -> RE: Flash Q&A thread 3 (4/17/2007 18:45:35)

it doesn't work




flsg -> RE: Flash Q&A thread 3 (4/18/2007 17:03:03)

well it should




petermaxo -> RE: Flash Q&A thread 3 (4/19/2007 15:36:09)

Grr... I just realized it was that pesky _root.onEnterFrame again![:@]
good news is, Problem solved (finally)[:)]

and in case anyone's wondering, I am working on something big. I may tell you about it when I am done.




SirSchmoopy -> RE: Flash Q&A thread 3 (4/19/2007 16:30:40)

How do i put the thing i make on a piczo page??




SirSchmoopy -> RE: Flash Q&A thread 3 (4/20/2007 7:14:18)

Also, how would i make a character fight a monster? it's kinda hard, especially since i dont know how to program these scripty things....
Edit: ty so much for all the stuff it really helps!!!




flsg -> RE: Flash Q&A thread 3 (4/20/2007 16:27:30)

SirSchmoopy: wow, your question is waaaaaaay too large...if you don't know flash AS and want to create a RPG, then use RPGMXP, it's easier and gives you many templates. Or you could learn flash AS




SirSchmoopy -> RE: Flash Q&A thread 3 (4/20/2007 18:31:12)

no offence flsg, but flsg doesnt work becuz all it is it a bunch of writing and talking and its confusing and i dont kno wht they're doing and why they dont just get me sumtin to make a game (rpg)......i only have 29 days to make it.......




somebody621 -> RE: Flash Q&A thread 3 (4/20/2007 23:45:44)

If you can't understand RMXP, than an rpg in flash IS WAY TOO MUCH. In fact, for MOST people, an rpg is way too much. If you're too lazy to understand RMXP, I'm sorry, you can't learn flash. No offence or anything...




flsg -> RE: Flash Q&A thread 3 (4/21/2007 12:16:09)

hey somebody, you're back!!!(where you gone? lol)
and yes SirSchmoopy, somebody is right. BTW, I don't like RPGMXP




EragonZZZZ -> RE: Flash Q&A thread 3 (4/21/2007 15:33:40)

No offense, I absolutely hate all the game maker programs that basically do the work for you.

I hate even more those "Free sprite sheets" sites that allow you to basically create sprites that look awesome with other people's art. Blech.


And, dude, there's a ton you could do with the free trial. Just don't start with an RPG; start with like a simple space shooter.


(lol, i knew i said i was leaving the forums, but this i felt required a comment)




SirSchmoopy -> RE: Flash Q&A thread 3 (4/22/2007 20:23:28)

Yay! i bought one ofthe books some1 recomended and now im getting used to flash, but still, can some1 tell em whts wrong with this thing for my button:
theButton.onRelease = function(){
trace("Ouch! !");
}




flsg -> RE: Flash Q&A thread 3 (4/23/2007 20:10:21)

SirSchmoopy: which book are you talking about?
and there's nothing wrong in the code, but do you have a button of the same name?
but I'm not sure you can used to flash in 1 week, it took me 2 years...




SirSchmoopy -> RE: Flash Q&A thread 3 (4/25/2007 19:07:06)


quote:

ORIGINAL: flsg

SirSchmoopy: which book are you talking about?
and there's nothing wrong in the code, but do you have a button of the same name?
but I'm not sure you can used to flash in 1 week, it took me 2 years...

o, then i must be doing sumtin wrong cuz its the same name as the button i made yet it still doesnt work. also i didnt learn EVERYTHING about it, i just kno a bit




flsg -> RE: Flash Q&A thread 3 (4/26/2007 17:03:03)

ok, let me see that:
where is the code? is it on the same depth(on _root, a movieclip, etc) as the button?




petermaxo -> RE: Flash Q&A thread 3 (4/26/2007 18:55:46)

Code:

_root.onEnterFrame = function(){
trace(action)
if(_global.action == "hit"){
if(_global.condition == "ready"){
_root.player.removeMovieClip()
_root.attachMovie("playerhit", "player", 2, {_x:200,_y:300})
_root.player.play()
_global.condition = "wait"
}
}trace(action)
}

Problem: nothing happens. it doesn't even trace the variable. No error message appears when I check it.




flsg -> RE: Flash Q&A thread 3 (4/27/2007 15:59:38)

don't tell me it's another onEnterFrame error...XD(I told you to not abuse them lol)
is the variable action defined? if it is, where is it? on _root? or somewhere else?




petermaxo -> RE: Flash Q&A thread 3 (4/27/2007 17:02:07)

no it is not another one of those. all variables are defined, and even if they weren't it would still trace 'undefined'.




flsg -> RE: Flash Q&A thread 3 (4/30/2007 17:20:51)

where did you put the code? perhaps on a frame that doesn't even play




petermaxo -> RE: Flash Q&A thread 3 (5/2/2007 17:14:39)

they are defined in the first scene.the problems are in the 15th.




Page: <<   < prev  3 4 [5] 6 7   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
9.179688E-02