dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: romdom placement and random loadmovie

  1. #1
    Senior Member
    Join Date
    Mar 2003
    Location
    New Orleans
    Posts
    191

    romdom placement and random loadmovie

    I have a mini anim that i'd like to play on the main flash document.

    I had the code before but I lost all the FLA's.

    So how do I randomly load swf's from 1-10,

    and how do I place the movie clip into which the anim's are loaded, randomly on ths stage?

    thanks
    Last edited by lelales; 08-24-2004 at 07:29 PM.
    I'm only in it for the pleasure

  2. #2
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    code:

    createEmptyMovieClip("loader",10);
    _root.yourbtn.onRelease = function() {
    loader.loadMovie("swfs"+(random(10)+1));
    loader._x = random(550);
    loader._y = random(400);
    };

    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  3. #3
    Senior Member
    Join Date
    Mar 2003
    Location
    New Orleans
    Posts
    191

    thanks joejoe228 but . . .

    I slightly modified your code.

    Here's what I have in the main movie on the first frame

    Code:
    loader._x = random(750);
    loader._y = random(550);
    loader.loadMovie("circles"+(random(10)+1)+".swf");
    Then in each of circle1.swf-circles10.swf I have the following code in the last frame
    Code:
    loader._x = random(750);
    loader._y = random(550);
    loader.loadMovie("circles"+(random(10)+1)+".swf");
    But for some reason my circles are showing up in the bottom right corner of the movie and not being placed randomly.
    And it's n ot loading random movies. It keeps reloading the same movie.



    You can view this project here: http://www.caillouette.com/pixellux_test/
    If you don't see the circles, refresh the page.


    I need to circles to load radomly 1-10 and be placed randomly on the screen. When each of the circle.swf plays through, a new one is randomly loaded and randomly placed on the screen.
    The random loading is not working and the random x and y placement isn't working.

    any help is appreciated
    Last edited by lelales; 08-24-2004 at 07:46 PM.
    I'm only in it for the pleasure

  4. #4
    Senior Member
    Join Date
    Mar 2003
    Location
    New Orleans
    Posts
    191

    where's OldNewbie when you need him?

    Can anyone help with this?

    thanks
    I'm only in it for the pleasure

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