dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: HELP - left side assignment AND setInterval !!!

  1. #1
    Member
    Join Date
    May 2000
    Location
    germany
    Posts
    55

    HELP - left side assignment AND setInterval !!!

    i have the following problem:

    when i use this["d" + dno] = 4; inside a function
    and then set an interval it doesnt work!!!
    it makes me mad... why???
    try the script:
    [you wont get the value for d: which should be 4]
    output:
    c: 1
    d:
    ----------------------------------------------------

    cno = 1;
    this["c" + cno] = 1;
    trace("c: " + c1);

    function move() {
    dno = 1;
    this["d" + dno] = 4;
    trace("d: " + d1);
    clearInterval(moveID);
    }

    moveID = setInterval(move, 1);

    stop();

    ----------------------------------------------------

    ...but it works if i dont use the interval...!!!!
    try the script:
    output:
    c: 1
    d: 4
    ----------------------------------------------------

    cno = 1;
    this["c" + cno] = 1;
    trace("c: " + c1);

    function move() {
    dno = 1;
    this["d" + dno] = 4;
    trace("d: " + d1);
    clearInterval(moveID);
    }

    move();

    stop();

    ----------------------------------------------------

    any idea? any help? i am really desperate...

    deeno
    2B II ! 2B

    ...shakespear adapted to c++

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    it has just to do with target paths
    Code:
    	_root["d"+dno] = 4;
    	trace("d: "+_root.d1);
    works

  3. #3
    Member
    Join Date
    May 2000
    Location
    germany
    Posts
    55
    sometimes it is so easy!

    many thanx!!!
    2B II ! 2B

    ...shakespear adapted to c++

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