-
Tired of spending days and hours on this,need help...
Okay this problem I've been trying to find out for a total of 3 days so far...and I'm still getting no where. I've got a first person level all designed,with the ships(X-wings)coming twoards you. My original plan was for the player to shoot the X Wings down with the mouse/cursor. I went over a few shooting tutorials and it seems that the only way I can see is to use a button. The thing is my movie clip is animated,and the button can only be on one frame. I tried doing David Doull's thing on this(already was able to do it with a 2-d setup),but I just got actionscript errors,I eventually worked around that but ended up with dots on the screen instead of a steady laser. Well undid all that so I'm not I'm just back down to 6 X-Wings....and a cursor. Help would be appreciated,thanks.
-
smile for the camera!
just use _root.onMouseDown.
its used like this:
_root.onMouseDown = function(){
//do whatever you want to do here
}
it basically makes it so when the user clicks the mouse, something happens.
My site
The Current Project is RoboRace.
Screens Public Beta Coming Soon!
-
Wow thanks. Doing I was able to finally get a laser sound on mouseclick. Now for the ships. I'm kind of confusing myself trying to think on how. Now lets say I want an actionscript in which if the cursor over laps X Wing 1 and mouse is down,X Wing visible=false. Only part I can't seem to find is the one in which I can let it know the cursor is over the X Wing...
-
Gah damnit,nothing in the world is working. I tried
on (rollOver) {
tellTarget ("xwing3") {removeMovieClip("xwing3");
}
and the clip isn't being removed...can anyone help me in making an invisible button(as other forums have suggested)? Everytime I try it only goes on one frame and never works/screws up.
-
Style Through Simplicity
cant you just put..
code:
on (press) {
_visible = false
}
?
Ali
-
But don't presses only work on buttons? This is an animated movieclip.
-
Style Through Simplicity
Im not sure about previous versions, but in mx 2004 it will work on a movieclip too.
Ali
-
Ah thanks man,I'll try it.
-
Strange..I get no Actionscript errors,but the Movieclip's visibility isn't becoming false..ay dios mio..:-\
-
President
Code:
onClipEvent(mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)){
this._visible = false;
}
}
You could also set it to an enterFrame if you want it to check constantly, not only when you press.
This is MC. His _parents sent him to stop() by the super market to buy some _root beer if he wanted to gotoAndPlay() with his friends at the park later.
This is my Blog!... The gaming Process
Please check out my site: Giddel Creations
-
Omg sweet,finally got it. What happened was the clip(Xwing3) I was working on was all screwed,in other words,kind of not a movieclip within. Tried on a diffrent one and it worked fine..just gotta fix that one. Add some explosions and whatnot,and hopefully make it move on to next level after all are gone(I'm thinking of using score or something)and I'm FINALLY all done here. Thanks guys.
-
President
Hope to see your game soon around here.
This is MC. His _parents sent him to stop() by the super market to buy some _root beer if he wanted to gotoAndPlay() with his friends at the park later.
This is my Blog!... The gaming Process
Please check out my site: Giddel Creations
-
I'll definitely post it,most likely www.sheezyart.com first. My name is the same there if you ever visit it. XD. One more error though...well,it just happened,the,error you could call it,is Target not found: Target="Explosion" Base="_level0.xwing6".
My code is,
Code:
on (press) {
_visible = false
}
on (press) {
(explode)=new Sound();
explode.attachSound("explode01");
explode.start([0,1])
}
on (press) {tellTarget ("Explosion") {gotoAndPlay(2);
}
}
The tell target part is the part that gives me this message,
Target not found: Target="Explosion" Base="_level0.instance16"
Well the number changes depending on which ship. Well,I've never used Telltarget anyways,any alternatives?
-
You need to give that movieclip a instance name.
After that,change the code like this:
Code:
on (press) {
tellTarget (this._parent.Explosion)
{
gotoAndPlay(2);
}
}
This should be work.
It doesn't work? Just put the two movieclips in the same scene.
-
Thanks that did it.
-
Originally Posted by CurlyHayami
Okay this problem I've been trying to find out for a total of 3 days so far...and I'm still getting no where. I've got a first person level all designed,with the ships(X-wings)coming twoards you. My original plan was for the player to shoot the X Wings down with the mouse/cursor. I went over a few shooting tutorials and it seems that the only way I can see is to use a button. The thing is my movie clip is animated,and the button can only be on one frame. I tried doing David Doull's thing on this(already was able to do it with a 2-d setup),but I just got actionscript errors,I eventually worked around that but ended up with dots on the screen instead of a steady laser. Well undid all that so I'm not I'm just back down to 6 X-Wings....and a cursor. Help would be appreciated,thanks.
dude, just make a layer on the bottom of the animation and put a button the length of the animation and put the code inside.
Last edited by The_Mercenary; 06-15-2005 at 04:28 AM.
Reason: sp
-
I take it you didn't read any other posts,I worked it all out mon. XD. Thanks anyways. Only problem I have now is the all too common gotoAndPlay not working when a certain score is reached. I've tried framelabels. I've tried _root.total,_root.score,just score. I've tried ==,I've tried >=. I've tried on movieclips,cause I learned from searching that it must be run over and over instead of just once,but nothing is moving it on to next frame when it reaches 100. I take it I'm not making it run repeatedly right..or not at all.
Last edited by CurlyHayami; 06-15-2005 at 10:10 PM.
-
W0000TAGE. Got it mon,finally. Yea it should've been _root.gotoAndPlay. I had just gotoAndPlay instead. WARHARHARHAR. YESSSS! Thanks for all your assitance guys.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|