[Xerte] Trying to overlay a grid for positioning in Xerte 2.10

Paul Swanson Paul.Swanson at harlandfs.com
Wed Apr 7 19:17:48 BST 2010


Ahhhh, then I could do the whole routine in the setup script. That
sounds like the best way to go. I'll play with that and let you know how
it goes.

 

Thanks, Jules!

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: Wednesday, April 07, 2010 11:05 AM
To: Xerte discussion list
Subject: RE: [Xerte] Trying to overlay a grid for positioning in Xerte
2.10

 

you could do 

 

rootIcon.createEmptyMovieClip('gridlines', someBigDepthNumber);

 

and then draw into that clip - then it always be above anything, even
the root entry frame,

 

J

 

________________________________

From: xerte-bounces at lists.nottingham.ac.uk on behalf of Paul Swanson
Sent: Wed 07/04/2010 17:24
To: Xerte discussion list
Subject: [Xerte] Trying to overlay a grid for positioning in Xerte 2.10

I'm working on a routine to create gridlines to assist in positioning
some rectangles that I draw with code. I've got the gridlines working,
but they end up under the framework for the individual lessons and I
need them on top. Here's the approach I'm using:

I have a flag variable to turn it on and off in my setup script, and the
graphic icon I draw it on, and the code to draw the gridlines, are in
the main entry frame of the interface icon. This works until I enter
another framework, at which point the other framework sits on top of my
gridlines. I've tried using swapDepths with a numeric value of 10000,
which should be higher than the depth of any other icon, and I've also
tried using the id of the framework in place of the numeric value. I've
even moved the code to the page where I draw the rectangle, and used the
icon id of the screen shot graphic with swapDepths, but it always
appears under the framework. Anyone have any idea? 

More details:

Setup script has:

gridLines = true; // set to false to turn off

In Interface icon Entry Frame I have a graphic icon with an ID of 'grid'

Script icon that draw gridlines has following code:

if (gridLines) {

    // set grid to high depth

    grid.swapDepths(10000);

    // grid line intervals

    gridInterval = 50;

    grid.lineStyle(1,0x000000,100);

    // vertical grids

    for (gridX = 0; gridX <= stageWidth; gridX) {

        grid.moveTo(gridX, 0);

        grid.lineTo(gridX, stageHeight);

        gridX = gridX + gridInterval;

    }

    

    // horizontal grids

    for (gridY = 0; gridY <= stageHeight; gridY) {

        grid.moveTo(0, gridY);

        grid.lineTo(stageWidth, gridY);

        gridY = gridY + gridInterval;

    }

}

_____________________________ 

 Paul Swanson
 Instructional Designer
 Harland Financial Solutions
 800.274.7280 Ext. 2462
 Paul.Swanson at harlandfs.com
_____________________________ 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20100407/340cc11e/attachment.html


More information about the Xerte mailing list