A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Trying to move several clips all at once using a simple for loop

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Posts
    250

    Trying to move several clips all at once using a simple for loop

    Using code shown below;

    var i:int = 0;
    var v:String = "ioc";

    for(i=0; i<3; i++)
    {
    trace(i); //0-4 OK
    trace(ioc.2.x = 100 // clip two moves OK
    trace (v+i); //ioc1, ioc2,ioc3 etc OK

    NOW, trying to move all clips(ioc1, ioc2, ioc3) on the stage at once, so I try...
    v+i.x = 100; // I get error... Cannot assign to a non-reference value.
    }

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Without seeing your file try it like this,
    PHP Code:
    var i:int;
    var 
    v:String "ioc";

    for (
    03i++)
    {
        
    trace(i);
        
    trace(String(i));
        
    this[String(i)].100;


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