Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 Viewsokay I'm in actionscript 2, and I have drawn a gun that I have under this actionscript (where the gun is "cursor")-
stop();
Mouse.hide();
startDrag("_root.cursor",true);
inside the movie clip I have a stop action on the timeline, then after that the gun firing.
What I want to know, is what code can I use so that when I click, it plays the gun firing? I have a feeling its something along the lines of -
onClick - anywhere
play movie.cursor;
only it isn't that. Can anyone help?
HMMMMM
let me think.
First, in your movieclip, have 1 frame with stop on for it not firing, and the next frame have a movieclip inside with with the gun firing, but have the stop on the main movieclip. EG) 3 movieclips, one called MC, one called MCgun1, and MCgun2 (MCgun2 is the one firing).
Perhaps, if you have the cursor for the gun on screen and then having something like this in the movielcip:
on(press) {
this.gotoandstop(2);
}
then it will go to frame two on your main movieclip, use the firing animation, and stop.
NOW, DONT COPY/PASTE, underatand it, or else your not learning anything.
Destroyed.
420 blaze it faggot
At 10/3/09 12:33 PM, flailthefox wrote: HMMMMM
let me think.
First, in your movieclip, have 1 frame with stop on for it not firing, and the next frame have a movieclip inside with with the gun firing, but have the stop on the main movieclip. EG) 3 movieclips, one called MC, one called MCgun1, and MCgun2 (MCgun2 is the one firing).
Perhaps, if you have the cursor for the gun on screen and then having something like this in the movielcip:
on(press) {
this.gotoandstop(2);
}
then it will go to frame two on your main movieclip, use the firing animation, and stop.
NOW, DONT COPY/PASTE, underatand it, or else your not learning anything.
I understand it, but that actionscript is for a button, and i don't want it to fire when i click a BUTTON, just when i CLICK (anywhere in general). Thanks for the help and the learning motivation, but I haven't got any further.
At 10/3/09 12:35 PM, 7IsUnlucky wrote: Look at some of these.
wow. Great that really helped. And thanks for the amazing effort to actually help me. NOT. I don't want to surf through hours of tutorials I have already seen only to find just ONE piece of actionscript I could just get if someone who perhaps already knew it could nudge me in the right direction.
Could anyone else help?
learn frame coding:
function onMouseDown () {
//code
}
bad habbit coding:
onClipEvent(mouseDown) {
//code
}
At 10/3/09 02:11 PM, Yambanshee wrote: learn frame coding:
function onMouseDown () {
//code
}
Learn frame coding:
onMouseDown = function () {
//code
} At 10/3/09 03:20 PM, DanBomer wrote:At 10/3/09 02:11 PM, Yambanshee wrote: learn frame coding:Learn frame coding:
function onMouseDown () {
//code
}
onMouseDown = function () {
//code
}
Ive heard that my method is more efficient
use onMouseDown or something like that, you don't even need buttons
At 10/3/09 03:24 PM, Yambanshee wrote:At 10/3/09 03:20 PM, DanBomer wrote:Ive heard that my method is more efficientAt 10/3/09 02:11 PM, Yambanshee wrote: learn frame coding:Learn frame coding:
function onMouseDown () {
//code
}
onMouseDown = function () {
//code
}
Thanks, I've tried using that code, and i got this
onMouseDown = this.gotoandstop(2); {
//code
}
But i got a compiler error saying "Statement must appear within on/onClipEvent handler
can someone please correct this!?
Okay. I know have this -
on(onMouseDown) {
this.gotoandplay(2);
}
No compiler errors this time :), the downside however is that it doesn't do anything.
Just to recap, I want it so when you click the mouse; the timeline in the movie clip plays.
At 10/3/09 04:14 PM, Aeroth wrote: Okay. I know have this -
on(onMouseDown) {
this.gotoandplay(2);
}
No compiler errors this time :), the downside however is that it doesn't do anything.
Just to recap, I want it so when you click the mouse; the timeline in the movie clip plays.
Why the fuck would you put 2 ons?
You really should learn more about actionscript before trying to do anything.
Just make a big-ass box with 0 alpha and make it a button. Have it so when it's clicked on, whatever shit you want to happen happens,
420 blaze it faggot
Or, god damnit, why did you replace "function" with "gotoAndStop"? Do you even know what you're doing?
In a frame, put this:
onMouseDown = function () {
_root. MC NAME HERE.gotoAndStop(2);
} 420 blaze it faggot
At 10/3/09 06:41 PM, 7IsUnlucky wrote: Or, god damnit, why did you replace "function" with "gotoAndStop"? Do you even know what you're doing?
In a frame, put this:
onMouseDown = function () {
_root. MC NAME HERE.gotoAndStop(2);
}
Oh I'm sorry if i gave the impression that I knew what I was doing by asking what to do.
Anyway, i'm not angry at you, I am happy. Thankies. It worked. (except i changed the Stop to a Play, that way it played the whole movie clip)
420 blaze it faggot