SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy doesnt recognize a dynamic clip in AS2

    i created dynamic clips and attached a movieClip to them:
    Code:
    for (i=0; i<6; i++) {
    	this.createEmptyMovieClip("targetClip"+i, this.getNextHighestDepth());
    	_root["targetClip"+i]._x = i*20;
    	_root["targetClip"+i].attachMovie("btnM"+i, squere, this.getNextHighestDepth());
    }
    i added a button to each clip:
    Code:
    for (var m:Number = 0; m<11; m++) {
    	this["targetClip"+m] = addBehaviour(m);
    }
    function addBehaviour(m) {
    	this["targetClip"+m].onRelease = function() {
    		pressed(this._name);
    	};
    }
    function pressed(storedName) {
    	storedName = storedName.slice(10, 12);
    	_root["targetClip"+storedName]._y = 400;
    }
    and it doesnt recognize :_root["targetClip"+storedName]._y

    i dont understand what i am doing wrang?

  2. #2
    SitePoint Wizard jim_morrison3's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    2,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Run a trace command and see what do you get as the output.
    Good Luck!
    There are things known and Things unknown
    And in between are the Doors.
    I love hand Coding.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •