A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Urgent help required !!!!!!!!!!!!!!

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Posts
    473

    Smile

    I have a move clip which is 212 x 211, within that movie clip i want random placed, speed and sized arrows to move from top right to bottom left.

    The reason its in a movie clip is due to the fact that i need to place it in a certain position in my movie

    Help...

    Really urgent

    Thanx


  2. #2
    Senior Member
    Join Date
    Feb 2002
    Location
    Lebanon
    Posts
    573
    Hi friend..
    I understood your problem, but still there is something I want to know: do you want the arrows to be moving or not?

    in both cases you can attach the arrows to the mc by the attachMovie() method, or you can use the
    duplicateMovieClip() method.. to do that you have to make a loop (for, or while).
    like this:
    Code:
    //this code could be inside the mc
    for (var i=0; i<10; i++){
        this.attachMovie("arrow", "arrow"+i, i);
        this["arrow"+i]._x = random(211);
        this["arrow"+i]._y = random(211);
        this["arrow"+i]._xscale = random(100);
        this["arrow"+i]._yscale = this["arrow"+i]._xscale;
    }
    //this loop generates 10 arrows, and places them in random positions and give them random size. you have to assign a linkage name from the library of the "arrow" mc, so that its exported on runtime.
    if you want the arrows to be moving, you have to put the move code inside the arrow mc in this form:

    this.onEnterFrame = function(){
    ....
    }

    that's all..
    if you needed more, please don't hesitate to ask me at:
    kingmaks@yahoo.com

    best regards.
    m.saleh

  3. #3
    Member
    Join Date
    Jan 2001
    Posts
    49
    create a init arrow object

    in the library linkage propertys name it "arrow" and check export for actionscript

    on the movieclip, where the arrows should be placed, copy following code:

    onClipEvent(load){
    i=1;
    }
    onClipEvent(enterFrame){
    this.attachMovie("arrow","arrow" add i, i);
    ran=random(100)+50; //these can be changed
    aro=this["arrow" add i];
    aro._x=-10;
    aro._y=-10;
    aro._xscale=ran;
    aro._yscale=ran;
    aro.speed=ran;

    aro.onEnterFrame=function(){
    this._x+=this.speed;
    this._y-=this.speed;
    }
    }
    //the script only creates the objects and moves them along your desired path.... you have to insert another routine to delete them after they get out of the boundry

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Posts
    473
    Cheers guys...

    badbadzmaru your code never seemed to work, not too sure what was going.... have a look for yourself, im no expert to solve the problem

  5. #5
    Member
    Join Date
    Jan 2001
    Posts
    49
    yes, forgot the increment:

    onClipEvent(load){
    i=1;
    }
    onClipEvent(enterFrame){
    this.attachMovie("arrow","arrow" add i, i);
    ran=random(100)+50; //these can be changed
    aro=this["arrow" add i];
    aro._x=-10;
    aro._y=-10;
    aro._xscale=ran;
    aro._yscale=ran;
    aro.speed=ran;

    aro.onEnterFrame=function(){
    this._x+=this.speed;
    this._y-=this.speed;
    }
    i++;
    }

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Posts
    473
    ok this isnt really want im wanting....

    Baically in a movie clip that 200 x 200 i want arrows to move from the top right corner to the bottom left corner.

    All being diffrent sizes, speed and alpha


  7. #7
    Senior Member
    Join Date
    Feb 2002
    Location
    Lebanon
    Posts
    573
    ok ok..
    man I'll send you a sample file.

    just wait alittle.

    best regards,

    m.Saleh

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