A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [RESOLVED] Using For Loop to Scale Movie clips

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    528

    [RESOLVED] Using For Loop to Scale Movie clips

    I am pretty sure I am close on this but for some reason this is not working. I have three movie clips on stage. When I click a button I want them to enlarge by 25%. I will be adding more movie clips dynamically so I need an array. Currently the clips are not scaling and I need to do that.

    This is the code
    ai = new Array("aione_mc", "aitwo_mc", "aithree_mc");
    removeControl_mc.onRelease = function() {
    // trace(scale);
    if ((scale>=25) && (scale<=99)) {
    for (i=0; i<ai.length; i++) {
    trace(ai[i]);
    ai[i]._xscale = scale;
    ai[i]._yscale = scale;
    }
    scale = scale+25;
    //ai1._xscale = scale;
    //ai1._yscale = scale;
    }
    };

    Thanks for the assistance.

  2. #2
    OOP is one letter from OOPS kortex's Avatar
    Join Date
    Aug 2005
    Location
    New Hope, PA
    Posts
    2,668
    I assume scale is orignally set somewhere else in the movie?
    Jeremy Wischusen
    Flash - Flex - LAMP - Web Developer Purple Inc
    AS OOP FAQ-Best Practices Thread | Flashkit OOP Tutorials | Purple Inc (day job) | Blog


  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    528
    yes, right above that code scale=100

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    Code:
    ai = new Array(aione_mc, aitwo_mc, aithree_mc);
    remove the quotations marks..otherwise u are creating strings, they dont then refer to the movieclips themsleves
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  5. #5
    Senior Member
    Join Date
    Apr 2001
    Posts
    528
    ah. Perfect. Thanks for solving that. Works perfect now.

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