Results 1 to 1 of 1

Thread: getting a class to place an object in the main flash file

  1. #1
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Question getting a class to place an object in the main flash file

    I am trying to get this code to repeat itself

    Code:
    import ascb.util.NumberUtilities;
    var random_generator:uint = NumberUtilities.random(0,3);
    //the array:
    var place_to_put_object=[one,two,three,four];
    //number to designate which holder object will be parented to
    var random_num:Number=random_generator;
    //place object chosen at random in holder 
    var name_item_and_placeit=place_to_put_object[random_num];
    //create the instance of the target_mc movieclip and place it into the now 
    //randomly generated square it should go into
    
    stage.addEventListener(MouseEvent.CLICK,fun_with_boxes_woohoo);
    function fun_with_boxes_woohoo(evt:MouseEvent):void
    {
    var target_mc:MovieClip = new Target_mc();
    name_item_and_placeit.addChild(target_mc);
    }
    Last edited by evan; 08-06-2009 at 09:11 PM.

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
  •