dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: target something for me

  1. #1
    Junior Member
    Join Date
    May 2004
    Location
    Springfield, OR
    Posts
    21

    target something for me

    im using action script ver1

    ive got a movie clip with this script:

    onClipEvent (load) {
    kNbrBullets = 0;
    this.onPress = function() {
    var mc = this.attachMovie('level1', 'bill', ++kNbrBullets);
    mc._x = this._xmouse;
    mc._y = this._ymouse;
    };
    }

    so when you click it, it creates a new mc.

    ive also got another mc with this script:

    onClipEvent (mouseDown) {
    if (_root.????????, hittest(_root.wall)) {
    gotoAndPlay("wall");
    }
    }

    as you can see, i want it to see if the new movie clip is hitting the wall. what do i put in the ??? to target it? it goes up by ++kNbrBullets each time. somebody else made that script, so i dont know what means what, a noob at flash my self. please help, i can't find anybody to help me for months!!!!!1

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    this.attachMovie('level1', 'bill', ++kNbrBullets)

    that line means:
    attach the movieclip with identifier 'level1' and give it the new name of 'bill'

    so your other script could be:

    if (_root.firstMc.bill.hitTest(_root.wall))//etc

    replace 'firstMC' with the instance name of the movieclip that holds the first attachMovie code. and notice that the correct syntax is hitTest() with an uppercase 'T'.

    gparis

  3. #3
    Junior Member
    Join Date
    May 2004
    Location
    Springfield, OR
    Posts
    21

    didnt work

    im using this script now:

    onClipEvent (mouseDown) {
    if (_root.bigbill.bill.hitTest(_root.wall)) {
    gotoAndPlay("wall");
    }
    }

    and for some reason when there is more than one bill, i don't think it is even touching the wall, it just plays (not the wall frame, but just plays). if you would like to take a look at the fla, say so. the idea of the game is that you click and it puts the face of bill cosby where you clicked, and you click that, and it puts another one there. you have to keep clicking and it forms a 'caterpillar' like chain, and you can't let them touch a wall.

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