Autor | Zpráva | ||
---|---|---|---|
TokrBlesk Profil * |
#1 · Zasláno: 28. 3. 2005, 16:45:20
Problem s hitTestem
|
||
TokrBlesk Profil * |
#2 · Zasláno: 28. 3. 2005, 16:49:01
Problem s hitTestem v dynamicky pridanem tlacitku (prominte nemam cas to prelozit pokracuji v anglictine)
Ive got a problem with a hittest that isnt working. Im testing a hit on a button added dynamicaly. I can access the movie clip's properties but my hittest wont work. First this is where I add the buttons and store the linkages in an array: ActionScript: MenuWheelClass.prototype.MenuWheel_MakeButtons = function() { for(var i=0;i<this.NumBttns;i++){ //Add the buttons this.mc = new Object; this.mc = this._clip.attachMovie(this.BttnClips[i],"Bttn" + (i+1), i+2); this.mc._x = Math.cos(Math.PI/180*(this.BttnPositions[i]-90))*this.BttnRadius; this.mc._y = Math.sin(Math.PI/180*(this.BttnPositions[i]-90))*this.BttnRadius; this.mc._rotation = this.BttnPositions[i]-90; this.mc.onPress = this.MenuWheel_onClick; //Add to list for further reference this.CurButtons.push(this.mc); } }; and this is where the hittest is: ActionScript: MenuWheelClass.prototype.MenuWheel_MouseIsOverBttn = function ( ) { // checks if the mouse is over any of the items // reset the current item just in case the mouse is not over anything this.CurrentBttnIndex = undefined; // loop through all the items in the menu for (var j = 0; j < this.CurButtons.length; j++) { //This works trace("this.CurButtons[j]._name = " + this.CurButtons[j]._name); //and so does this trace("this._clip.Bttn1._name = " + this._clip.Bttn1._name); // check if the mouse is over the item //CANT MAKE THIS HITTEST WORK!!! if (this.CurButtons[j].hitTest(_root._xmouse, _root._ymouse, true)) { trace("hittest " + this.CurButtons[j]._name); this.CurrentBttnIndex = j; return true; } } } and maybe I should mention that this is all part of a smartclip. If anyone has any insight into my problem I would be thankful for it. |
||
Hanz Profil |
#3 · Zasláno: 28. 3. 2005, 17:26:43
Mohl bys to dát někam nainternet nastažení? --> podíval bych se na to.
|
||
TokrBlesk Profil * |
#4 · Zasláno: 29. 3. 2005, 09:56:00
Mnelo by to jit stahnout tady:>>http://www3.telus.net/TomasKrejcar
|
||
Časová prodleva: 20 let
|
Toto téma je uzamčeno. Odpověď nelze zaslat.
0