dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [Resolved] MSN Friends?

  1. #1
    BradyWhite.net Kac's Avatar
    Join Date
    Nov 2000
    Location
    Orem, UT
    Posts
    576

    MSN Friends?

    Just wondering if anyone here could help me with some actionscript, if so my e-mail is sataracsNOSPAM@hotmail.com (remove the NOSPAM)

    I have just simple questions

    and please don't move me to actionscript forum, people here help me

    for my first Q:
    Code:
    for (i=1;i<5;i++){
    	if (sub1Var == i){
    		trace(i);
    		trace(eval("text"+i+"Links")[i]);
    		for (j=0;j<11;j++){
    			myButt = "subNav"+j+"_butt";
    			eval(myButt).onRelease = function(){
    				//When it Works put it in here: getMyUrl(eval(eval("text"+i+"Links"))[j]);
    				trace(i);
    				trace(eval("text"+i+"Links")[this._name.charAt(6)]);
    			}			
    		}
    	}
    }
    when I click on my button, it says that i = 5, but on my first trace statement it is dynamic according to what sub1Var equals, why would this be? Does the for loop with the j statement through it off?

    blast!

  2. #2

    Re: MSN Friends?

    Originally posted by Kac
    Just wondering if anyone here could help me with some actionscript, if so my e-mail is sataracsNOSPAM@hotmail.com (remove the NOSPAM)

    I have just simple questions

    and please don't move me to actionscript forum, people here help me

    for my first Q:
    Code:
    for (i=1;i<5;i++){
    	if (sub1Var == i){
    		trace(i);
    		trace(eval("text"+i+"Links")[i]);
    		for (j=0;j<11;j++){
    			myButt = "subNav"+j+"_butt";
    			eval(myButt).onRelease = function(){
    				//When it Works put it in here: getMyUrl(eval(eval("text"+this.myVar+"Links"))[j]);
    				trace(i);
    				trace(eval("text"+i+"Links")[this._name.charAt(6)]);
    			}			
    		}
    	}
    }
    when I click on my button, it says that i = 5, but on my first trace statement it is dynamic according to what sub1Var equals, why would this be? Does the for loop with the j statement through it off?

    blast!
    this happens to me a lot, it seems that flash doesn't dereference i until it calls the function, at which point i == 5 (because it exited the loop). try creating a variable in the button and trace that.

    code:

    ...
    eval(myButt).onRelease = function(){
    //When it Works put it in here: getMyUrl(eval(eval("text"+i+"Links"))[j]);
    this.myVar = i;
    trace(this.myVar);
    trace(eval("text"+this.myVar+"Links")[this._name.charAt(6)]);
    }


  3. #3
    BradyWhite.net Kac's Avatar
    Join Date
    Nov 2000
    Location
    Orem, UT
    Posts
    576
    Thanks for your help!

    This is what I did,
    I added a variable in the first I loop, and then referred back to that variable in the button, this way it would call that variable even after i had gone to 5.

    I stared at that code long and hard today

    thanks again for the help.

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