Skip to main content
September 8, 2009
Question

Strange display glitch

  • September 8, 2009
  • 1 reply
  • 832 views

(AS3, Win XP, CS4, publihsh in FlashPlayer 9, viewed in FlashPlayer10)

I've encounntered a strange 'glitch' in CS4

I'm using a lot (20+) simple lineTo commands to create the links in a menu tree structure.

The targets or the tree structure move so hence the lineTo end point moves so hence needs to be redrawn - this is happening on EnterFrame.

The problem is that quite often (predictably often) once the 3rd level is drawn there are grey boxes (the colour of the line) flashing on and off the screen, sort of paying attention to the lines being drawn but in places not bounded by them.

These lineTo's are ALL single lines with just 2 vertex's and a single straght line between them, so no shape to fill etc.

Does that makes sense to anyone.

Ask away and i'll try to clarify any points, needless to say it's driving me nuts

regards, Rich

This topic has been closed for replies.

1 reply

Inspiring
September 8, 2009

Posting code would be helpful.

September 8, 2009

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

Inspiring
September 8, 2009

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?