Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Duplicate Movie Clips?

  1. #1
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default Duplicate Movie Clips?

    I am trying to create a movie where a movieclip appears at random on screen and tweens across. I am using the tutorial found here (http://www.actionscript.org/resource...ts/Page1.html). I am able to get the image to appear and move across the screen, once a button is pressed. However, i have realized that if the button is not pressed within a few seconds of the movie loading, the movie clip does not duplicate.
    I'd really appreciate any help i could get.
    Thanks.

    Engine to create random movie clips
    Code:
    onClipEvent (enterFrame) {
    	_root.top1.play();
    	_root.bottom1.play();
    	totalNum=200;
    	if (_root.delay) {
    		if (Math.floor(getTimer()/1000) == _root.lastTime+1) {
    			_root.delay = true;
    		}
    	} else if (Math.floor(getTimer()/1000) == _root.lastTime+_root.wait) 
    	{
    		_root.lastTime = Math.floor(getTimer()/1000);
    		_root.delay = false;
    		// custom actions begin
    		_root.count = _root.count+1;
    		if (_root.count <= totalNum) {
    			duplicateMovieClip("_root.clip", "clip"+_root.count, _root.count);
    			_root["clip"+_root.count]._y = random(350)+50;
    		}
    		// custom actions end
    	}
    }
    On another frame, _root.wait=2

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Code:
    duplicateMovieClip("_root.clip", "clip"+_root.count, _root.count);
    The red section is the level, higher numbers get placed higher on the stage. this can either be removed completely, or use a static number or getNextHighestDepth();

    Another problem (and I apologize for my "shots in the dark" here but I haven't been in a Flash frame of mind for a couple weeks and I am getting rusty) is you are trying to duplicate a movie clip and your function does it when the clip enters the frame.

    Since this is done on a button press, try changing the

    Code:
    onClipEvent (enterFrame) {
    to
    Code:
    onClipEvent (load) {
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default

    I changed the clip event to on load and the same thing still happened.
    I tried attaching the .fla to this post however i guess i can not do that. I have provided the source here,
    http://www.home.southernct.edu/~chaputs1/bud2.fla
    --
    Please excuse the context of the game, haha.
    Thank you Blizzard, that is the first response i have gotten on many fourms.
    ---

    Also, i have tried to work out the leveling but i am not sure what is happening, i would need the duplicated movie to appear on the utmost bottom layer and whenever i change the number to, 1,2,3 or anything it makes the image appear randomly however it only moves half way across the screen. :/
    Last edited by SChaput; 02-20-2008 at 01:51 AM.

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    I will take a look as soon as things slow down at work here today, will try to get back to you ASAP.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default

    Thank you.
    I have also been working on a timer, which i got to work however it starts the beginning of the movie and not at the start of the game itself, if you have time to show me how to do that id appreciate it, if not, im sure i can find a tutorial or something.
    Thanks again.

  6. #6
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Is the timer in the download already? I downloaded it before I made my post above, check my post time. If you have added it after, please reupload and link again.

    It is looking more and more like I will have to wait til I get home from work today (about 4 more hours) But I will check it out.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  7. The Following User Says Thank You to BLiZZaRD For This Useful Post:

    SChaput (02-22-2008)

  8. #7
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default

    Yes the timer is already in the flash file.
    Everything is there to make it work i believe, my only concern is it might be unorganized and may be hard to decipher haha.

  9. #8
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Okay, I am looking at this, and you do have things all over the place. If you give me a couple days I can rework some of the more major problems.

    For instance you have 2 MCs (so far) that have the same name.. not good for AS, you also have if statements not == to anything.

    I have a few projects ahead of this though so I would need time. If you are in a hurry there is always the purchase plan

    If there is anything specific I need to know about it tell me here and I will make sure it gets worked in.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  10. #9
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default

    yea i tried to make it in a haste and am a naturally unorganized person haha. Uh...the only other thing i was planning on adding was something that saved a persons personal high score, however i think that is something that i need to use databases for so that may be far down the road, haha.
    I really appreciate any time you can spend working on this, thank you.

  11. #10
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Just to verify...

    You have the "hero" able to move as it does with a gravitational force in effect. You have the "baddies" coming cross screen in multiples, at random.

    No health.. one hit kill (no pun intended) and same goes for top and bottom borders.

    The timer should start on game start and this is also the score, higher is better.

    Integrate a high score system for the various players to compete against each other this way.

    Did I miss anything?


    Going through it again, if this is all there is to it, you have a TON of stuff in there that is not needed at all.

    If, on the other hand I missed something, please let me know. This is quite fun. Even though most of my projects are games, I haven't coded a game in ages. Been working mainly on apps and proggies.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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