A Flash Developer Resource Site

Results 1 to 19 of 19

Thread: Tired of spending days and hours on this,need help...

  1. #1
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17

    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.

  2. #2
    smile for the camera! jesserules's Avatar
    Join Date
    Dec 2004
    Location
    a dark place where people have trouble in flash
    Posts
    720
    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!

  3. #3
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17
    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...

  4. #4
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17
    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.

  5. #5
    Style Through Simplicity alillm's Avatar
    Join Date
    Mar 2004
    Location
    Wales
    Posts
    1,988
    cant you just put..

    code:

    on (press) {
    _visible = false
    }



    ?

    Ali

  6. #6
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17
    But don't presses only work on buttons? This is an animated movieclip.

  7. #7
    Style Through Simplicity alillm's Avatar
    Join Date
    Mar 2004
    Location
    Wales
    Posts
    1,988
    Im not sure about previous versions, but in mx 2004 it will work on a movieclip too.

    Ali

  8. #8
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17
    Ah thanks man,I'll try it.

  9. #9
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17
    Strange..I get no Actionscript errors,but the Movieclip's visibility isn't becoming false..ay dios mio..:-\

  10. #10
    President PhobiK's Avatar
    Join Date
    Jan 2005
    Location
    Guatemala
    Posts
    918
    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

  11. #11
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17
    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.

  12. #12
    President PhobiK's Avatar
    Join Date
    Jan 2005
    Location
    Guatemala
    Posts
    918
    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

  13. #13
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17
    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?

  14. #14
    L.S(Little Shieh)
    Join Date
    Jun 2005
    Location
    Taiwan
    Posts
    28
    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.

  15. #15
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17
    Thanks that did it.

  16. #16
    Senior Member
    Join Date
    Jun 2005
    Posts
    203
    Quote 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

  17. #17
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17
    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.

  18. #18
    Lord Vader
    Join Date
    Jun 2005
    Posts
    17
    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.

  19. #19
    L.S(Little Shieh)
    Join Date
    Jun 2005
    Location
    Taiwan
    Posts
    28
    You are welcome^^

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center