PDA

View Full Version : [AS3] Jump Script Issue


superman6791
04-06-2010, 06:59 PM
Whats wrong here?

//Fixed Jumps
if(hero.Velocity_Y > 1) {
disable jump;
}


here's the variable "Jump"

var jump = key("spacebar");

superman6791
04-06-2010, 07:30 PM
When I use this script, the first part works, not the second part.

What it does is when you jump, if you press the jump button when he is falling(The REVERSE section) he jumps back up and hovers. How can I fix this???

//Fixed Jumps
if(hero.Velocity_Y > 1) {
element ("Jump").hide (true);
}

//Reverse
if(hero.Velocity_Y WHAT GOES HERE!!! ) {
element ("Jump").hide (true);
}

rrh
04-06-2010, 07:34 PM
Where are you getting stuff like 'key("spacebar")' or 'disable jump?'

I tried to look up the element ("").hide (true) thing you were using in the other thread, but all the top search results were you asking on forums what's wrong with your code.

I suspect you're trying to use some old AS1 code, that's been deprecated since Flash 5 or maybe something that's not even Actionscript?

superman6791
04-06-2010, 07:48 PM
We also tried this:

if(hero.Velocity_Y == 0) {
element ("Jump").show (true)
}
else
{
element ("Jump").show (false)
}


Didn't work either

abeall
04-06-2010, 09:58 PM
It doesn't work because it's not AS3. Where did you find this script?

newblack
04-07-2010, 02:29 PM
could be actionscript, and the OP's just not sharing the method "element" for some reason.

OP: you can't post a snippet of nonsense with no context and expect any help. spend the time to thoroughly detail your problem; where it's failing, what you think the issue might be, what's preventing you from figuring it out yourself, etc. it might take a bit longer than pasting the above snippet, but the alternative, as you've seen, is nobody being ABLE to help.

NoobsArePeople2
04-07-2010, 03:46 PM
It doesn't work because it's not AS3. Where did you find this script?


Looks like JavaScript to me.