-
1. Re: Strange display glitch
Andrei1 Sep 8, 2009 8:41 AM (in response to SlickRik)Posting code would be helpful.
-
2. Re: Strange display glitch
SlickRik Sep 8, 2009 8:57 AM (in response to Andrei1)code that draw's the lines:
public function drawLineToSubs():void
menuHolder.graphics.clear();
for each (var obj:MenuItem in menuItemArray) {
var tX:Number = obj.x;
var tY:Number = obj.y;
menuHolder.graphics.lineStyle(1, 0xffffff, 0.05);
menuHolder.graphics.moveTo(item.x, item.y);
menuHolder.graphics.lineTo(tX, tY);
}
}-------------
where menuHolder is a Sprite()
where type MenuItem is a class that extends MovieClip and contains the subnodes for that level, each subNode object within menuHolder would contain another menuHolder and run the above class locally if has childNodes.
i never get multiple lines on the screen (other that those i desire) so graphics.clear() is def working
regards, Rich
-
3. Re: Strange display glitch
Andrei1 Sep 8, 2009 9:18 AM (in response to SlickRik)What do you refer to when you say "above class"? Is function drawLineToSubs a method of an instance or it is on timeline?
What is the item.x/item.y in the code?
Are you saying that an object is moving on a timeline and you are connecting children with these lines. Or children are moving inside their parents too?
-
4. Re: Strange display glitch
SlickRik Sep 8, 2009 9:26 AM (in response to Andrei1)sorry, yeah, taht would help.
class View - is the root.
class MenuItem is instantiated into View.
class MenuItem contains an empty Sprite() called menuHolder.
class MenuHolder instaitiates all it's subNodes inside it's menuHolder
Each subnode which gets instantiated is another instance of MenuItem
drawLineToSubs() is a public method of the class MenuItem
I know it's likely odd/bad practice to instantiate a class within itself but the nature of the project demanded it unfortunately.
the tree continues down another 2 levels
View => MenuItem - menuHolder ==> MenuItem - menuHolder ==> MenuItem
==> MenuItem
==> MenuItem
==> MenuItem - menuHolder ==> MenuItem
==> MenuItem
==> MenuItem
does that make sense?
R
-
5. Re: Strange display glitch
Andrei1 Sep 8, 2009 9:40 AM (in response to SlickRik)It does make sense.
And why is it a bad practice to instantiate class inside itself? We do it all the time with Sprites and MovieClips.
I still cannot picture though why you say that line drawing happens on enter frame? It would make sense if the objects are moving, otherwise, why bother?
-
6. Re: Strange display glitch
SlickRik Sep 9, 2009 4:34 AM (in response to Andrei1)HI Andrei,
yes - the objects are in motion, each node in the tree moves in response to the mouse proximity and few other factors.

