A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: making target move around like another one help!!!!! actionscript2.0

  1. #1
    Junior Member
    Join Date
    May 2009
    Location
    Elmhurst, Illinois
    Posts
    20

    making target move around like another one help!!!!! actionscript2.0

    hello my name is fabo i need help making another symbol(object) to move around randomly like another symbol i made here is the script for the symbol

    onClipEvent (load) {
    this._x = random(550);
    this._y = random(310)+90;
    }
    on (press) {
    _root.score += 5;
    this.gotoAndPlay(4);
    }

    i need to make another symbol like this one that moves around same way i think i need to make a new layer???
    please make next script for new symbol so it will to move around the same way.
    or tell me what to write in the new script for the symbol thanks fabo!!!

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    You want to duplicate an MC and have it move to random locations? If you're using AS 2.0, then you'll use duplicateMovieClip.

    Here is more information: http://help.adobe.com/en_US/AS2LCR/F...=00001290.html
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  3. #3
    Junior Member
    Join Date
    May 2009
    Location
    Elmhurst, Illinois
    Posts
    20
    i tried to copy a script from the other target and making a new movie clip target and pasting the script in that one but it still doesnt work what should i do/??


    onClipEvent (load) {
    this._x = random(550);
    this._y = random(310)+90;
    }
    on (press) {
    _root.score += 5;
    this.gotoAndPlay(4);
    }
    ϜάҌФ

  4. #4
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    Do you want to do it at runtime or authoring time?
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  5. #5
    Junior Member
    Join Date
    May 2009
    Location
    Elmhurst, Illinois
    Posts
    20
    i would like to do it at runtime the code is normal
    ϜάҌФ

  6. #6
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    You would use something like this:
    Code:
     attachMovieClip(linkage Name, Stage Name, depth,{_x:Math.random()*550, _y:Math.random()*310});
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  7. #7
    Junior Member
    Join Date
    May 2009
    Location
    Elmhurst, Illinois
    Posts
    20
    i dont know how to put the stage name and stuff in. my symbol movie clip is called target what is linkage name, stage name, and depth???
    ϜάҌФ

  8. #8
    Junior Member
    Join Date
    May 2009
    Location
    Elmhurst, Illinois
    Posts
    20
    here is my other symbols script
    PHP Code:
    onClipEvent (load) {
        
    this._x random(550);
        
    this._y random(310)+90;
    }
    on (press) {
        
    _root.score += 5;
        
    this.gotoAndPlay(4);

    ϜάҌФ

  9. #9
    Junior Member
    Join Date
    May 2009
    Location
    Elmhurst, Illinois
    Posts
    20
    and the code you gave me is not formatted i dont know how to put it in srry im a nubie
    ϜάҌФ

Tags for this Thread

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