A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: problem with dynamically assign onRollOver function

  1. #1
    Member
    Join Date
    Apr 2003
    Location
    North East, MD
    Posts
    62

    problem with dynamically assign onRollOver function

    Got a small problem with assigning onRollOver / onRollOut functions to movieclips in a for loop.

    Code sample:
    Code:
    for(i = 0; i < num_squares; i++){
    	clip = "window"+i;
    	this.attachMovie("window",clip,100+i);
    
    	this[clip].onRollOver = function(){
    		eval(clip).resize_me(200,200,.2);
    	}
    }
    This always makes the last instance number resize when i mouse over any of the clips. (if num_squares = 6, it makes window5 resize)

    Another thing i've noticed is if I use
    Code:
     this[clip].resize_me
    it doesnt do anything, not even a mouseOver pointer.

    Thanks
    "I hate when people put quotes in their signatures" -anonymous

  2. #2
    Registered User
    Join Date
    Aug 2002
    Posts
    61
    try clip=eval("windows"+i); first so it does the eval before info gets passed to it.

    then in the RollOver function try this[clip].resize_me();

  3. #3
    Member
    Join Date
    Apr 2003
    Location
    North East, MD
    Posts
    62
    nope, doesnt work. But thanks for the tip of using eval before assigning to the variable.

    Any other ideas?
    "I hate when people put quotes in their signatures" -anonymous

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